user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<_upse_psf_get_tag>:
  endbr64
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  lea    0x1(%rdi),%rbx
  cmpb   $0x0,(%rdi)
  mov    %rbx,%rax
  je     L251
L257:
  movzbl (%rax),%edx
  add    $0x1,%rax
  lea    -0x1(%rdx),%ecx
  cmp    $0x1e,%cl
  ja     L33
L226:
  movzbl (%rax),%edx
  movb   $0x20,-0x1(%rax)
  add    $0x1,%rax
  lea    -0x1(%rdx),%ecx
  cmp    $0x1e,%cl
  jbe    L226
L33:
  test   %dl,%dl
  jne    L257
L251:
  mov    %r13,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x1(%r13,%rax,1),%rax
  cmp    %rax,%r13
  jbe    L158
  jmp    L184
  nopl   (%rax)
L18:
  movb   $0x0,(%rax)
  sub    $0x1,%rax
  cmp    %rax,%r13
  ja     L184
L158:
  cmpb   $0x20,(%rax)
  je     L18
L184:
  movzbl 0x0(%r13),%eax
  cmp    $0x20,%al
  je     L140
  jmp    L191
  nopl   0x0(%rax)
L241:
  add    $0x1,%rbx
L140:
  movzbl (%rbx),%eax
  mov    %rbx,%r13
  cmp    $0x20,%al
  je     L241
L191:
  mov    %r13,%rbx
  cmp    $0x3d,%al
  jne    L105
  jmp    L203
  nopw   0x0(%rax,%rax,1)
L247:
  movzbl 0x1(%rbx),%eax
  add    $0x1,%rbx
  cmp    $0x20,%al
  je     L206
  cmp    $0x3d,%al
  je     L206
L105:
  test   %al,%al
  jne    L247
L90:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nop
L206:
  mov    %rbx,%r14
  sub    %r13,%r14
  lea    0x1(%r14),%edi
L52:
  call   <malloc@plt>
  mov    %rax,0x0(%rbp)
  mov    %rax,%rdi
  test   %rax,%rax
  je     L90
  mov    %r14d,%edx
  mov    %r13,%rsi
  call   <strncpy@plt>
  mov    0x0(%rbp),%rax
  movb   $0x0,(%rax,%r14,1)
  movzbl (%rbx),%eax
  cmp    $0x3d,%al
  jne    L57
  jmp    L246
  nopl   0x0(%rax,%rax,1)
L231:
  movzbl 0x1(%rbx),%eax
  add    $0x1,%rbx
  cmp    $0x3d,%al
  je     L246
L57:
  test   %al,%al
  jne    L231
  jmp    L90
  nopw   0x0(%rax,%rax,1)
L246:
  cmpb   $0x20,0x1(%rbx)
  lea    0x1(%rbx),%rbp
  jne    L11
  nopw   0x0(%rax,%rax,1)
L73:
  add    $0x1,%rbp
  cmpb   $0x20,0x0(%rbp)
  je     L73
L11:
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%edi
  call   <malloc@plt>
  mov    %rax,(%r12)
  mov    %rax,%rdi
  test   %rax,%rax
  je     L90
  mov    %rbp,%rsi
  call   <strcpy@plt>
  pop    %rbx
  mov    $0x1,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L203:
  mov    $0x1,%edi
  xor    %r14d,%r14d
  jmp    L52
```

assistant: ```c
int _upse_psf_get_tag(char *buf, char **key, char **val) {
  char *tmp;
  tmp = buf;
  while (*tmp++)
    if (*tmp > 0 && *tmp < 0x20)
      *tmp = 0x20;
  for (tmp = buf + strlen(buf) - 1; tmp >= buf; tmp--) {
    if (*tmp != 0x20)
      break;
    *tmp = 0;
  }
  while (*buf == 0x20)
    buf++;
  tmp = buf;
  while ((*buf != 0x20) && (*buf != '=')) {
    if (!*buf)
      return (0);
    buf++;
  }
  if (!(*key = malloc(buf - tmp + 1)))
    return (0);
  strncpy(*key, tmp, buf - tmp);
  (*key)[(buf - tmp)] = 0;
  while (*buf != '=') {
    if (!*buf)
      return (0);
    buf++;
  }
  buf++;
  while (*buf == 0x20) {
    if (!*buf)
      return (0);
    buf++;
  }
  if (!(*val = malloc(strlen(buf) + 1)))
    return (0);
  strcpy(*val, buf);
  return (1);
}
```