user: 请将以下的汇编代码转换成C语言代码:

```asm
<mysql_query_digest_and_first_comment>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  lea    0x1(%rsi),%edi
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdx,0x18(%rsp)
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  test   %ebp,%ebp
  jle    L338
  movb   $0x0,0x13(%rsp)
  mov    %rax,%r12
  mov    %rax,%r15
  xor    %r13d,%r13d
  movl   $0x0,0x4(%rsp)
  xor    %r9d,%r9d
  xor    %esi,%esi
  movb   $0x0,0x12(%rsp)
  movb   $0x0,0x11(%rsp)
  jmp    L571
  nopl   0x0(%rax,%rax,1)
L547:
  movsbl (%r14),%edi
  cmp    $0x2f,%r9b
  je     L92
L54:
  mov    %esi,(%rsp)
  cmp    $0x23,%dil
  je     L584
  cmp    $0x27,%dil
  je     L193
  cmp    $0x22,%dil
  je     L193
  movsbl %r9b,%r12d
  mov    %r9b,0x14(%rsp)
  mov    %r12d,%edi
  call   <is_token_char@plt>
  movzbl 0x14(%rsp),%r9d
  mov    (%rsp),%esi
  test   %rax,%rax
  jne    L363
L635:
  cmpb   $0x0,0x13(%rsp)
  je     L437
L523:
  mov    %r12d,%edi
  call   <is_space_char@plt>
  test   %rax,%rax
  jne    L223
L263:
  movb   $0x1,0x13(%rsp)
  movsbl (%r14),%edi
  mov    %r15,%r12
  nopw   0x0(%rax,%rax,1)
L157:
  call   <is_space_char@plt>
  mov    %rax,%r9
  mov    $0x20,%eax
  test   %r9,%r9
  jne    L207
  movzbl (%r14),%eax
L207:
  mov    %al,(%r15)
  mov    %ebx,%esi
  movzbl (%r14),%r9d
  add    $0x1,%r15
  add    $0x1,%r14
L576:
  cmp    %ebp,%esi
  jge    L197
L571:
  lea    0x1(%rsi),%ebx
  test   %r13b,%r13b
  je     L547
  cmp    $0x1,%r13b
  je     L517
  cmp    $0x2,%r13b
  je     L606
  cmp    $0x3,%r13b
  jne    L622
  lea    0x1(%r12),%rax
  cmp    %ebx,%ebp
  je     L688
  movsbl (%r14),%edi
  cmp    %r15,%rax
  jae    L33
  cmp    $0x5c,%r9b
  je     L278
  cmp    0x11(%rsp),%r9b
  je     L18
L33:
  movzbl 0x11(%rsp),%ecx
  cmp    %cl,%dil
  jne    L157
  cmp    %cl,0x1(%r14)
  je     L157
  mov    %ebx,%esi
  movb   $0x3f,(%r12)
  add    $0x1,%r14
  mov    %rax,%r15
  xor    %r13d,%r13d
  cmp    %ebp,%esi
  jl     L571
  nopl   (%rax)
L197:
  cmp    0x8(%rsp),%r15
  jbe    L6
  cmpb   $0x20,-0x1(%r15)
  je     L142
L6:
  movb   $0x0,(%r15)
  mov    0x8(%rsp),%rax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L193:
  mov    %dil,0x11(%rsp)
  mov    %r15,%r12
  mov    $0x3,%r13d
  jmp    L157
  nopl   0x0(%rax,%rax,1)
L517:
  movzbl (%r14),%eax
  cmpb   $0x1,0x12(%rsp)
  movsbl %al,%edi
  jg     L168
  cmpl   $0x3fe,0x4(%rsp)
  jle    L327
L574:
  movb   $0x1,0x12(%rsp)
  movsbl %al,%edi
  cmp    $0x2a,%r9b
  jne    L157
  cmp    $0x2f,%al
  jne    L157
  mov    0x4(%rsp),%edx
  mov    $0x1,%eax
  cmp    $0x1,%edx
  je     L154
  sub    $0x2,%edx
  mov    %edx,0x4(%rsp)
  movslq %edx,%rax
L154:
  mov    0x18(%rsp),%rcx
  movb   $0x2,0x12(%rsp)
  movb   $0x0,(%rcx,%rax,1)
  movzbl (%r14),%eax
  movsbl %al,%edi
  cmp    $0x2f,%dil
  jne    L157
  nopl   0x0(%rax)
L625:
  lea    -0x1(%r12),%r15
L285:
  add    $0x1,%r14
  mov    %ebx,%esi
  xor    %r13d,%r13d
  mov    $0x20,%r9d
  jmp    L576
  nopl   0x0(%rax)
L168:
  cmp    $0x2a,%r9b
  jne    L157
  movsbl %al,%edi
  cmp    $0x2f,%dil
  jne    L157
  jmp    L625
  nopl   0x0(%rax)
L92:
  cmp    $0x2a,%dil
  jne    L54
  mov    %r15,%r12
  mov    $0x1,%r13d
  jmp    L157
L606:
  movsbl (%r14),%edi
  cmp    $0xa,%dil
  je     L390
  cmp    $0xd,%dil
  jne    L157
L390:
  mov    %r12,%r15
  jmp    L285
  nopl   0x0(%rax)
L584:
  mov    %r15,%r12
  mov    $0x2,%r13d
  jmp    L157
  xchg   %ax,%ax
L622:
  cmp    %r15,%r12
  je     L643
  movsbl (%r14),%edi
  call   <is_token_char@plt>
  test   %rax,%rax
  jne    L413
  cmp    %ebx,%ebp
  je     L200
  movsbl (%r14),%edi
  mov    $0x4,%r13d
  jmp    L157
  nopw   0x0(%rax,%rax,1)
L327:
  movsbl %al,%edi
  mov    %r9b,(%rsp)
  call   <is_space_char@plt>
  movzbl (%rsp),%r9d
  mov    %rax,%r10
  mov    $0x20,%eax
  test   %r10,%r10
  jne    L330
  movzbl (%r14),%eax
L330:
  movslq 0x4(%rsp),%rsi
  mov    0x18(%rsp),%rcx
  mov    %rsi,%rdx
  mov    %al,(%rcx,%rsi,1)
  movzbl (%r14),%eax
  add    $0x1,%edx
  mov    %edx,0x4(%rsp)
  jmp    L574
  nopw   0x0(%rax,%rax,1)
L278:
  cmp    $0x5c,%dil
  je     L246
L18:
  cmp    0x11(%rsp),%dil
  jne    L157
L246:
  add    $0x1,%r14
  mov    %ebx,%esi
  mov    $0x58,%r9d
  jmp    L576
  nopw   0x0(%rax,%rax,1)
L200:
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   <is_digit_string@plt>
  test   %rax,%rax
  jne    L611
L507:
  movsbl (%r14),%edi
  xor    %r13d,%r13d
  jmp    L157
  nopl   0x0(%rax,%rax,1)
L363:
  movsbl (%r14),%edi
  mov    %r9b,(%rsp)
  mov    %esi,0x14(%rsp)
  call   <is_digit_char@plt>
  movzbl (%rsp),%r9d
  test   %rax,%rax
  je     L635
  cmp    %ebx,%ebp
  mov    0x14(%rsp),%esi
  je     L533
  movsbl (%r14),%edi
  mov    %r15,%r12
  mov    $0x4,%r13d
  jmp    L157
  nopl   (%rax)
L643:
  movb   $0x3f,(%r12)
  lea    0x1(%r12),%r15
  mov    %ebx,%esi
  mov    $0x4,%r13d
  jmp    L576
  nopw   0x0(%rax,%rax,1)
L437:
  movsbl (%r14),%edi
  mov    %r9b,(%rsp)
  call   <is_space_char@plt>
  movzbl (%rsp),%r9d
  test   %rax,%rax
  je     L523
  add    $0x1,%r14
  xor    %r13d,%r13d
  mov    %r15,%r12
  mov    %ebx,%esi
  jmp    L576
  nopl   0x0(%rax)
L223:
  movsbl (%r14),%edi
  call   <is_space_char@plt>
  test   %rax,%rax
  je     L263
  movb   $0x20,(%r15)
  add    $0x1,%r14
  mov    %r15,%r12
  mov    %ebx,%esi
  movb   $0x1,0x13(%rsp)
  mov    $0x20,%r9d
  jmp    L576
  nop
L413:
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   <is_digit_string@plt>
  test   %rax,%rax
  je     L507
  movb   $0x3f,(%r12)
  lea    0x1(%r12),%r15
  cmp    %ebx,%ebp
  je     L296
  movsbl (%r14),%edi
  xor    %r13d,%r13d
  jmp    L157
  xchg   %ax,%ax
L142:
  movb   $0x0,-0x1(%r15)
  jmp    L6
L688:
  movb   $0x3f,(%r12)
  mov    %rax,%r15
  jmp    L197
L338:
  mov    %rax,%r15
  jmp    L6
L533:
  mov    %r15,%r12
  mov    $0x4,%r13d
  jmp    L576
L611:
  movb   $0x3f,(%r12)
  lea    0x1(%r12),%r15
L296:
  movsbl (%r14),%edi
  call   <is_token_char@plt>
  test   %rax,%rax
  je     L197
  movzbl (%r14),%eax
  lea    0x2(%r12),%r15
  mov    %al,0x1(%r12)
  jmp    L197
```

assistant: ```c
char *mysql_query_digest_and_first_comment(char *s, int len, char *first_comment) {
  int i = 0;
  char *r = (char *)malloc(len + sizeof(char));
  char *p_r = r;
  char *p_r_t = r;
  char prev_char = 0;
  char qutr_char = 0;
  char flag = 0;
  char fc = 0;
  int fc_len = 0;
  char fns = 0;
  while (i < len) {
    if (flag == 0) {
      p_r_t = p_r;
      if (prev_char == '/' && *s == '*') {
        flag = 1;
      } else if (*s == '#') {
        flag = 2;
      } else if (*s == '\'' || *s == '"') {
        flag = 3;
        qutr_char = *s;
      } else if (is_token_char(prev_char) && is_digit_char(*s)) {
        flag = 4;
        if (len == i + 1)
          continue;
      } else {
        flag = 0;
        if (fns == 0 && is_space_char(*s)) {
          s++;
          i++;
          continue;
        }
        if (fns == 0)
          fns = 1;
        if (is_space_char(prev_char) && is_space_char(*s)) {
          prev_char = ' ';
          *p_r = ' ';
          s++;
          i++;
          continue;
        }
      }
    } else {
      if (flag == 1) {
        if (fc == 0) {
          fc = 1;
        }
        if (fc == 1) {
          if (fc_len < 1024 - 1) {
            first_comment[fc_len] = !is_space_char(*s) ? *s : ' ';
            fc_len++;
          }
          if (prev_char == '*' && *s == '/') {
            if (fc_len >= 2)
              fc_len -= 2;
            first_comment[fc_len] = 0;
            fc = 2;
          }
        }
      }
      if ((flag == 1 && prev_char == '*' && *s == '/') || (flag == 2 && (*s == '\n' || *s == '\r'))) {
        p_r = flag == 1 ? p_r_t - sizeof(char) : p_r_t;
        prev_char = ' ';
        flag = 0;
        s++;
        i++;
        continue;
      } else if (flag == 3) {
        if (len == i + 1) {
          p_r = p_r_t;
          *p_r++ = '?';
          flag = 0;
          break;
        }
        if (p_r > p_r_t + sizeof(char)) {
          if ((prev_char == '\\' && *s == '\\') || (prev_char == '\\' && *s == qutr_char) || (prev_char == qutr_char && *s == qutr_char)) {
            prev_char = 'X';
            s++;
            i++;
            continue;
          }
        }
        if (*s == qutr_char && (len == i + 1 || *(s + sizeof(char)) != qutr_char)) {
          p_r = p_r_t;
          *p_r++ = '?';
          flag = 0;
          if (i < len)
            s++;
          i++;
          continue;
        }
      } else if (flag == 4) {
        if (p_r_t == p_r) {
          *p_r++ = '?';
          i++;
          continue;
        }
        if (is_token_char(*s) || len == i + 1) {
          if (is_digit_string(p_r_t, p_r)) {
            p_r = p_r_t;
            *p_r++ = '?';
            if (len == i + 1) {
              if (is_token_char(*s))
                *p_r++ = *s;
              i++;
              continue;
            }
          }
          flag = 0;
        }
      }
    }
    *p_r++ = !is_space_char(*s) ? *s : ' ';
    prev_char = *s++;
    i++;
  }
  if (p_r > r) {
    char *e = p_r;
    e--;
    if (*e == ' ') {
      *e = 0;
    }
  }
  *p_r = 0;
  return r;
}
```