user: 请从给定的汇编指令推导出C源代码：

```asm
<nis_destroygroup>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L4
  mov    %rdi,%rbx
  cmpb   $0x0,(%rdi)
  jne    L120
L4:
  mov    D7(%rip),%rax
  mov    (%rax),%ebx
L81:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L131
  mov    %ebx,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L120:
  mov    %rsp,%r12
  call   <strlen@plt>
  lea    0x41(%rax),%rdx
  mov    %rdx,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rcx
  sub    %rdx,%rcx
L47:
  cmp    %rcx,%rsp
  je     L23
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L47
L23:
  mov    %rsi,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L14
  orq    $0x0,-0x8(%rsp,%rdx,1)
L14:
  mov    %rsp,%r13
  lea    0x3(%rax),%rsi
  add    $0x12,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L105:
  cmp    %rdx,%rsp
  je     L50
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L105
L50:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L36
  orq    $0x0,-0x8(%rsp,%rax,1)
L36:
  mov    %rsp,%rdi
  lea    0xf(%rsi),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L34:
  cmp    %rdx,%rsp
  je     L73
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L34
L73:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L132
  orq    $0x0,-0x8(%rsp,%rax,1)
L132:
  lea    -0x1(%rsi),%r15d
  mov    %r15d,%edx
  mov    %rdi,%rsi
  mov    %rbx,%rdi
  call   <nis_leaf_of_r@plt>
  mov    %rax,%rsi
  mov    %r13,%rdi
  call   <stpcpy@plt>
  mov    %rax,%r14
  movabs $0x5f7370756f72672e,%rax
  mov    %rax,(%r14)
  movl   $0x726964,0x8(%r14)
  mov    %r15d,%edx
  mov    %rsp,%rsi
  mov    %rbx,%rdi
  call   <nis_domain_of_r@plt>
  mov    %rax,%rsi
  test   %rax,%rax
  je     L129
  cmpb   $0x0,(%rax)
  jne    L49
L129:
  mov    $0x0,%esi
  mov    %r13,%rdi
  call   <nis_remove@plt>
  mov    %rax,%r13
  mov    %rax,%rdi
  call   <NIS_RES_STATUS@plt>
  mov    %eax,%ebx
  mov    %r13,%rdi
  call   <nis_freeresult@plt>
  mov    %r12,%rsp
  jmp    L81
L49:
  movb   $0x2e,0xb(%r14)
  lea    0xc(%r14),%rdi
  call   <strcpy@plt>
  jmp    L129
L131:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
nis_error nis_destroygroup(const_nis_name group) {
  if (group != NULL && group[0] != '\0') {
    size_t grouplen = strlen(group);
    char buf[grouplen + 50];
    char leafbuf[grouplen + 3];
    char domainbuf[grouplen + 3];
    nis_error status;
    nis_result *res;
    char *cp, *cp2;
    cp = stpcpy(buf, nis_leaf_of_r(group, leafbuf, sizeof(leafbuf) - 1));
    cp = stpcpy(cp, ".groups_dir");
    cp2 = nis_domain_of_r(group, domainbuf, sizeof(domainbuf) - 1);
    if (cp2 != NULL && cp2[0] != '\0') {
      *cp++ = '.';
      stpcpy(cp, cp2);
    }
    res = nis_remove(buf, NULL);
    status = NIS_RES_STATUS(res);
    nis_freeresult(res);
    return status;
  } else
    return NIS_FAIL;
}
```