user: What is the c source code of the assembly code below:

```asm
<pisa_cert_get_part>:
  endbr64
  test   %rdx,%rdx
  je     L22
  push   %r15
  mov    %rdx,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  test   %rsi,%rsi
  je     L108
  mov    %rdi,%rbp
  test   %rdi,%rdi
  je     L108
  mov    %rsi,%rdi
  mov    %rsi,(%rsp)
  call   <strlen@plt>
  mov    %eax,%r13d
  test   %eax,%eax
  je     L108
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L108
  movslq %r13d,%rdi
  mov    (%rsp),%rsi
  xor    %ebx,%ebx
  mov    %rdi,0x8(%rsp)
  jmp    L116
  cs nopw 0x0(%rax,%rax,1)
L81:
  xor    %eax,%eax
  cmpb   $0x29,0x0(%rbp)
  sete   %al
  sub    %eax,%ebx
  je     L108
  movzbl 0x1(%rbp),%eax
  lea    0x1(%rbp),%r14
  mov    %r14,%rbp
  test   %al,%al
  je     L108
L116:
  cmp    $0x28,%al
  jne    L81
  add    $0x1,%ebx
  cmp    $0x2,%ebx
  jne    L81
  lea    0x1(%rbp),%r14
  mov    %r13d,%edx
  mov    %rsi,(%rsp)
  mov    %r14,%rdi
  mov    %r14,%r12
  call   <strncmp@plt>
  mov    (%rsp),%rsi
  test   %eax,%eax
  mov    %eax,%edx
  jne    L71
  mov    0x8(%rsp),%rax
  cmpb   $0x20,0x1(%rbp,%rax,1)
  je     L197
L71:
  cmpb   $0x29,0x0(%rbp)
  mov    $0x1,%eax
  mov    %r14,%rbp
  cmove  %eax,%ebx
  movzbl (%r14),%eax
  test   %al,%al
  jne    L116
L108:
  movb   $0x0,(%r15)
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L22:
  xor    %eax,%eax
  ret
L197:
  movzbl 0x1(%rbp),%ecx
  test   %cl,%cl
  jne    L123
  jmp    L103
  nopl   (%rax)
L166:
  cmp    $0x29,%cl
  jne    L82
  sub    $0x1,%ebx
  cmp    $0x1,%ebx
  je     L203
L82:
  movzbl 0x1(%r12),%ecx
  add    $0x1,%r12
  test   %cl,%cl
  je     L103
L123:
  cmp    $0x28,%cl
  jne    L166
  movzbl 0x1(%r12),%ecx
  add    $0x1,%r12
  add    $0x1,%ebx
  test   %cl,%cl
  jne    L123
L103:
  mov    %r15,%rbx
L54:
  mov    %rbp,%rsi
  mov    %r15,%rdi
  call   <strncpy@plt>
  movb   $0x0,(%rbx)
  add    $0x18,%rsp
  mov    %r15,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L203:
  sub    %rbp,%r12
  lea    0x1(%r12),%edx
  movslq %edx,%rbx
  add    %r15,%rbx
  jmp    L54
```

assistant: ```c
char *pisa_cert_get_part(char *cert, const char *name, char *r) {
  int level = 0, len = 0;
  char *p = cert, *start = NULL;
  if (!r) {
    return NULL;
  }
  if (!cert) {
    goto out_err;
  }
  if (!name) {
    goto out_err;
  }
  len = strlen(name);
  if (len == 0) {
    goto out_err;
  }
  while (*p) {
    if (*p == '(') {
      level++;
      if (level == 2 && !strncmp(p + 1, name, len)) {
        if (*(p + len + 1) == ' ') {
          start = p++;
          break;
        }
      }
    }
    if (*p == ')') {
      level--;
    }
    if (level == 0) {
      break;
    }
    p++;
  }
  if (!start) {
    goto out_err;
  }
  len = 0;
  while (*p) {
    if (*p == '(') {
      level++;
    }
    if (*p == ')') {
      level--;
      if (level == 1) {
        len = p - start + 1;
        break;
      }
    }
    if (level == 0) {
      break;
    }
    p++;
  }
  strncpy(r, start, len);
  r[len] = '\0';
  return r;
out_err:
  r[0] = '\0';
  return NULL;
}
```