user: 下面的汇编指令对应的C源代码是什么:

```asm
<router_rewrite_metric>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %rcx,-0x60(%rbp)
  mov    %r8,-0x68(%rbp)
  mov    %r9,-0x70(%rbp)
  movb   $0x0,-0x39(%rbp)
  movl   $0x0,-0x38(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  movl   $0x0,-0x34(%rbp)
  cmpq   $0x0,0x10(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    0x10(%rbp),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x30(%rbp),%rax
  sub    -0x48(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  sub    -0x20(%rbp),%rax
  cmp    $0x1fff,%rax
  ja     L421
  jmp    L166
L232:
  mov    -0x20(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x30(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
L166:
  mov    -0x20(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jb     L232
  jmp    L3
L421:
  mov    $0x0,%eax
  jmp    L368
L3:
  mov    -0x68(%rbp),%rax
  mov    %rax,-0x28(%rbp)
L354:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x5c,%eax
  jne    L222
  cmpb   $0x0,-0x39(%rbp)
  jne    L222
  movb   $0x1,-0x39(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L164
L222:
  cmpb   $0x1,-0x39(%rbp)
  jne    L25
  cmpl   $0x0,-0x34(%rbp)
  jne    L25
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5f,%al
  jne    L25
  movl   $0x1,-0x34(%rbp)
  jmp    L157
L25:
  cmpb   $0x1,-0x39(%rbp)
  jne    L111
  cmpl   $0x0,-0x34(%rbp)
  jne    L111
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5e,%al
  jne    L111
  movl   $0x2,-0x34(%rbp)
  jmp    L157
L111:
  cmpb   $0x0,-0x39(%rbp)
  je     L346
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L346
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jg     L346
  movb   $0x2,-0x39(%rbp)
  mov    -0x38(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  add    %eax,-0x38(%rbp)
  jmp    L157
L346:
  cmpb   $0x0,-0x39(%rbp)
  je     L401
  cmpl   $0x0,-0x38(%rbp)
  jle    L255
  mov    -0x38(%rbp),%eax
  cltq
  cmp    %rax,-0x70(%rbp)
  jb     L255
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  js     L255
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mov    0x4(%rax),%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x30(%rbp),%rax
  sub    -0x48(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  sub    -0x20(%rbp),%rax
  cmp    $0x1fff,%rax
  ja     L255
  cmpl   $0x2,-0x34(%rbp)
  je     L348
  cmpl   $0x2,-0x34(%rbp)
  ja     L255
  cmpl   $0x0,-0x34(%rbp)
  je     L174
  cmpl   $0x1,-0x34(%rbp)
  je     L106
  jmp    L255
L17:
  mov    -0x20(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x30(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
L174:
  mov    -0x20(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jb     L17
  jmp    L255
L453:
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %rax,%rcx
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
L106:
  mov    -0x20(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jb     L453
  jmp    L255
L289:
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %rax,%rcx
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
L348:
  mov    -0x20(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jb     L289
  nop
L255:
  movl   $0x0,-0x38(%rbp)
L401:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  je     L157
  movb   $0x0,-0x39(%rbp)
  movl   $0x0,-0x34(%rbp)
  mov    -0x30(%rbp),%rax
  sub    -0x48(%rbp),%rax
  add    $0x1,%rax
  cmp    $0x1fff,%rax
  ja     L157
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  mov    -0x28(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  jmp    L157
L157:
  nop
L164:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L53
  addq   $0x1,-0x28(%rbp)
  jmp    L354
L53:
  nop
  subq   $0x1,-0x30(%rbp)
  mov    0x10(%rbp),%rax
  mov    0x4(%rax),%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x30(%rbp),%rax
  sub    -0x48(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  sub    -0x20(%rbp),%rax
  cmp    $0x1fff,%rax
  ja     L40
  jmp    L442
L132:
  mov    -0x20(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x30(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
L442:
  mov    -0x20(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jb     L132
  jmp    L186
L40:
  mov    $0x0,%eax
  jmp    L368
L186:
  mov    -0x50(%rbp),%rax
  mov    -0x30(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x30(%rbp),%rax
  sub    -0x48(%rbp),%rax
  mov    %rax,%rbx
  mov    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rbx,%rax
  cmp    $0x1fff,%rax
  ja     L54
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  jmp    L457
L237:
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  mov    -0x28(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  addq   $0x1,-0x28(%rbp)
L457:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L237
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movb   $0x0,(%rax)
  mov    -0x30(%rbp),%rax
  sub    -0x48(%rbp),%rax
  jmp    L368
L54:
  mov    $0x0,%eax
L368:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
size_t router_rewrite_metric(char (*newmetric)[8192], char **newfirstspace, const char *metric, const char *firstspace, const char *replacement, const size_t nmatch, const regmatch_t *pmatch) {
  char escape = 0;
  int ref = 0;
  char *s = *newmetric;
  const char *p;
  const char *q;
  const char *t;
  enum rewrite_case { RETAIN, LOWER, UPPER } rcase = RETAIN;
  assert(pmatch != NULL);
  q = metric;
  t = metric + pmatch[0].rm_so;
  if (s - *newmetric + t - q < sizeof(*newmetric)) {
    while (q < t)
      *s++ = *q++;
  } else {
    return 0;
  }
  for (p = replacement;; p++) {
    switch (*p) {
    case '\\':
      if (!escape) {
        escape = 1;
        rcase = RETAIN;
        break;
      }
    default:
      if (escape == 1 && rcase == RETAIN && *p == '_') {
        rcase = LOWER;
      } else if (escape == 1 && rcase == RETAIN && *p == '^') {
        rcase = UPPER;
      } else if (escape && *p >= '0' && *p <= '9') {
        escape = 2;
        ref *= 10;
        ref += *p - '0';
      } else {
        if (escape) {
          if (ref > 0 && ref <= nmatch && pmatch[ref].rm_so >= 0) {
            q = metric + pmatch[ref].rm_so;
            t = metric + pmatch[ref].rm_eo;
            if (s - *newmetric + t - q < sizeof(*newmetric)) {
              switch (rcase) {
              case RETAIN:
                while (q < t)
                  *s++ = *q++;
                break;
              case LOWER:
                while (q < t)
                  *s++ = (char)tolower(*q++);
                break;
              case UPPER:
                while (q < t)
                  *s++ = (char)toupper(*q++);
                break;
              }
            }
          }
          ref = 0;
        }
        if (*p != '\\') {
          escape = 0;
          rcase = RETAIN;
          if (s - *newmetric + 1 < sizeof(*newmetric))
            *s++ = *p;
        }
      }
      break;
    }
    if (*p == '\0')
      break;
  }
  s--;
  q = metric + pmatch[0].rm_eo;
  t = firstspace;
  if (s - *newmetric + t - q < sizeof(*newmetric)) {
    while (q < t)
      *s++ = *q++;
  } else {
    return 0;
  }
  *newfirstspace = s;
  if (s - *newmetric + strlen(firstspace) < sizeof(*newmetric)) {
    for (p = firstspace; *p != '\0'; p++)
      *s++ = *p;
    *s++ = '\0';
    return s - *newmetric;
  }
  return 0;
}
```