user: Translate the below assembly code into C programming language:

```asm
<CGSagaGetPairedValue>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdx,%r15
  mov    %ecx,0xc(%rsp)
  test   %rsi,%rsi
  sete   %al
  test   %rdx,%rdx
  sete   %dl
  or     %dl,%al
  jne    L307
  mov    %rdi,%rbx
  mov    %rsi,%r14
  test   %rdi,%rdi
  je     L307
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L109
  mov    $0x0,%eax
  mov    $0x0,%ecx
  jmp    L186
L329:
  add    $0x1,%eax
  movslq %eax,%rcx
  movzbl (%rbx,%rcx,1),%edx
  test   %dl,%dl
  je     L109
L186:
  cmp    $0x2f,%dl
  jne    L329
  cmpb   $0x2f,0x1(%rbx,%rcx,1)
  jne    L329
  movslq %eax,%rcx
  add    %rbx,%rcx
  cmpb   $0xa,(%rcx)
  je     L329
  mov    $0x0,%edx
  lea    0x1(%rax),%esi
L264:
  movb   $0x2f,(%rcx,%rdx,1)
  lea    (%rsi,%rdx,1),%eax
  add    $0x1,%rdx
  cmpb   $0xa,(%rcx,%rdx,1)
  jne    L264
  jmp    L329
L109:
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  mov    %rax,%r13
  mov    $0x0,%ecx
  test   %rax,%rax
  je     L292
  mov    %rax,%r12
  sub    %rbx,%r12
  mov    %r14,%rdi
  call   <strlen@plt>
  lea    (%rax,%r12,1),%ebp
  sub    $0x1,%r12d
  jmp    L240
L232:
  movslq %ebp,%rax
  movzbl (%rbx,%rax,1),%eax
  lea    -0x9(%rax),%edx
  cmp    $0x1,%dl
  setbe  %dl
  test   $0xdf,%al
  je     L131
  test   %dl,%dl
  jne    L131
L49:
  lea    0x1(%r13),%rdi
  mov    %r14,%rsi
  call   <strstr@plt>
  test   %rax,%rax
  je     L231
  mov    %rax,%rdx
  sub    %r13,%rdx
  add    %edx,%ebp
  add    %edx,%r12d
  mov    %rax,%r13
L240:
  test   %r12d,%r12d
  je     L232
  movslq %r12d,%rax
  movzbl (%rbx,%rax,1),%eax
  lea    -0x9(%rax),%edx
  cmp    $0x1,%dl
  jbe    L232
  test   $0xdf,%al
  je     L232
  jmp    L49
L131:
  test   %r13,%r13
  je     L218
  mov    $0x0,%ecx
  test   %al,%al
  je     L292
  cmp    $0x20,%al
  je     L18
  test   %dl,%dl
  je     L184
L18:
  lea    0x1(%rbp),%eax
  cltq
L408:
  mov    %eax,%ebp
  movzbl (%rbx,%rax,1),%edx
  add    $0x1,%rax
  lea    -0x9(%rdx),%ecx
  cmp    $0x1,%cl
  jbe    L408
  cmp    $0x20,%dl
  je     L408
L184:
  cmpl   $0x0,0xc(%rsp)
  je     L52
  movslq %ebp,%rax
  movzbl (%rbx,%rax,1),%eax
  test   %al,%al
  je     L35
  cmp    $0x22,%al
  je     L35
  lea    0x1(%rbp),%eax
  cltq
L164:
  mov    %eax,%ebp
  movzbl (%rbx,%rax,1),%edx
  add    $0x1,%rax
  test   %dl,%dl
  je     L35
  cmp    $0x22,%dl
  jne    L164
L35:
  add    $0x1,%ebp
L52:
  movslq %ebp,%rbp
  add    %rbp,%rbx
  movzbl (%rbx),%edx
  test   %dl,%dl
  je     L77
  cmp    $0xa,%dl
  je     L77
  mov    $0x1,%eax
  jmp    L247
L366:
  movzbl (%rbx,%rax,1),%edx
  add    $0x1,%rax
  test   %dl,%dl
  je     L300
  cmp    $0xa,%dl
  je     L300
L247:
  mov    %dl,-0x1(%r15,%rax,1)
  mov    %eax,%ecx
  cmpl   $0x0,0xc(%rsp)
  je     L366
  cmpb   $0x22,(%rbx,%rax,1)
  jne    L366
L300:
  movslq %ecx,%rcx
  movb   $0x0,(%r15,%rcx,1)
  mov    $0x1,%ecx
  jmp    L292
L77:
  mov    $0x0,%ecx
  jmp    L300
L307:
  mov    $0x0,%ecx
L292:
  mov    %ecx,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L231:
  mov    $0x0,%ecx
  jmp    L292
L218:
  mov    $0x0,%ecx
  jmp    L292
```

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;
}
```