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

```asm
<CGSagaGetPairedValue>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %ecx,-0x4c(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  je     L401
  cmpq   $0x0,-0x40(%rbp)
  je     L401
  cmpq   $0x0,-0x48(%rbp)
  jne    L449
L401:
  mov    $0x0,%eax
  jmp    L85
L449:
  movl   $0x0,-0x28(%rbp)
  jmp    L276
L210:
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L497
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L497
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L497
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L497
  jmp    L30
L144:
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2f,(%rax)
  addl   $0x1,-0x28(%rbp)
L30:
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L144
L497:
  addl   $0x1,-0x28(%rbp)
L276:
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L404
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L210
L404:
  mov    -0x40(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  jne    L132
  mov    $0x0,%eax
  jmp    L85
L132:
  mov    -0x20(%rbp),%rax
  sub    -0x38(%rbp),%rax
  mov    %eax,%ebx
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    %ebx,%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x20(%rbp),%rax
  sub    -0x38(%rbp),%rax
  sub    $0x1,%eax
  mov    %eax,-0x2c(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L145
L335:
  cmpl   $0x0,-0x2c(%rbp)
  je     L394
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L394
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L394
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L394
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L394
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L372
L394:
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L489
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L489
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L489
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L372
L489:
  movl   $0x1,-0x24(%rbp)
  jmp    L26
L372:
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x40(%rbp),%rax
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <strstr@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L44
  mov    -0x18(%rbp),%rax
  sub    -0x20(%rbp),%rax
  mov    %eax,%edx
  mov    -0x30(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x18(%rbp),%rax
  sub    -0x20(%rbp),%rax
  mov    %eax,%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  jmp    L145
L44:
  movq   $0x0,-0x20(%rbp)
  jmp    L26
L145:
  cmpl   $0x0,-0x24(%rbp)
  je     L335
L26:
  cmpl   $0x0,-0x24(%rbp)
  je     L251
  cmpq   $0x0,-0x20(%rbp)
  je     L251
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L251
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L143
L251:
  mov    $0x0,%eax
  jmp    L85
L67:
  addl   $0x1,-0x30(%rbp)
L143:
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L67
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L67
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  je     L67
  movl   $0x0,-0x28(%rbp)
  cmpl   $0x0,-0x4c(%rbp)
  je     L147
  jmp    L185
L370:
  addl   $0x1,-0x30(%rbp)
L185:
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L161
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  jne    L370
L161:
  addl   $0x1,-0x30(%rbp)
  jmp    L147
L355:
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x28(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x48(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x28(%rbp)
  addl   $0x1,-0x30(%rbp)
  cmpl   $0x0,-0x4c(%rbp)
  je     L147
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  je     L486
L147:
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L425
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L425
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L355
  jmp    L425
L486:
  nop
L425:
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    $0x1,%eax
L85:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int CGSagaGetPairedValue(char *buf, char *key, char *outbuf, int inquotes) {
  char *place, *placesecond;
  int startpoint, startletter;
  int i, found;
  if (!buf || !key || !outbuf) {
    return 0;
  }
  i = 0;
  while (buf[i] && buf[i] != '\0') {
    if (buf[i] == '/') {
      if (buf[i + 1] && buf[i + 1] != '\0' && buf[i + 1] == '/') {
        while (buf[i] != '\n') {
          buf[i] = '/';
          i++;
        }
      }
    }
    i++;
  }
  place = strstr(buf, key);
  if (!place) {
    return 0;
  }
  startpoint = place - buf + strlen(key);
  startletter = (place - buf) - 1;
  found = 0;
  while (!found) {
    if (startletter == 0 || !buf[startletter] || buf[startletter] == '\0' || buf[startletter] == 9 || buf[startletter] == ' ' || buf[startletter] == '\n') {
      if (buf[startpoint] == '\0' || buf[startpoint] == 9 || buf[startpoint] == ' ' || buf[startpoint] == '\n') {
        found = 1;
        break;
      }
    }
    placesecond = strstr(place + 1, key);
    if (placesecond) {
      startpoint += placesecond - place;
      startletter += placesecond - place;
      place = placesecond;
    } else {
      place = ((void *)0);
      break;
    }
  }
  if (!found || !place || !buf[startpoint] || buf[startpoint] == '\0') {
    return 0;
  }
  while (buf[startpoint] == ' ' || buf[startpoint] == 9 || buf[startpoint] == '\n') {
    startpoint++;
  }
  i = 0;
  if (inquotes) {
    while (buf[startpoint] && buf[startpoint] != '\"') {
      startpoint++;
    }
    startpoint++;
  }
  while (buf[startpoint] && buf[startpoint] != '\0' && buf[startpoint] != '\n') {
    outbuf[i] = buf[startpoint];
    i++;
    startpoint++;
    if (inquotes && buf[startpoint] == '\"') {
      break;
    }
  }
  outbuf[i] = '\0';
  return 1;
}
```