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

```asm
<do_parse_glob>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8,-0x58(%rbp)
  mov    %r9,-0x60(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    D40(%rip),%rax
  mov    (%rax),%esi
  lea    -0x20(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x0,%edx
  mov    %rax,%rdi
  call   <glob@plt>
  mov    %eax,-0x2c(%rbp)
  cmpl   $0x0,-0x2c(%rbp)
  je     L166
  mov    D33(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x2c(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    D36(%rip),%rax
  mov    (%rax),%eax
  jmp    L77
L166:
  cmpq   $0x0,-0x60(%rbp)
  je     L103
  mov    -0x60(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L103
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x50(%rbp),%rdx
  mov    -0x48(%rbp),%rsi
  mov    %rax,%rdi
  call   <w_addstr@plt>
  mov    -0x40(%rbp),%rdx
  mov    %rax,(%rdx)
  movl   $0x1,-0x30(%rbp)
  jmp    L40
L24:
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x50(%rbp),%rdx
  mov    -0x48(%rbp),%rsi
  mov    $0x20,%ecx
  mov    %rax,%rdi
  call   <w_addchar@plt>
  mov    -0x40(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L173
  mov    -0x18(%rbp),%rdx
  mov    -0x30(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rcx
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x50(%rbp),%rdx
  mov    -0x48(%rbp),%rsi
  mov    %rax,%rdi
  call   <w_addstr@plt>
  mov    -0x40(%rbp),%rdx
  mov    %rax,(%rdx)
L173:
  addl   $0x1,-0x30(%rbp)
L40:
  mov    -0x20(%rbp),%eax
  cmp    %eax,-0x30(%rbp)
  jge    L178
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L24
L178:
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <globfree@plt>
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L193
  mov    D36(%rip),%rax
  mov    (%rax),%eax
  jmp    L77
L193:
  mov    $0x0,%eax
  jmp    L77
L103:
  cmpq   $0x0,-0x60(%rbp)
  je     L69
  mov    -0x60(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L49
L69:
  mov    $0x1,%eax
  jmp    L147
L49:
  mov    $0x0,%eax
L147:
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L157
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x50(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <w_newword@plt>
  mov    -0x40(%rbp),%rdx
  mov    %rax,(%rdx)
L157:
  movl   $0x0,-0x30(%rbp)
  jmp    L128
L14:
  mov    -0x18(%rbp),%rdx
  mov    -0x30(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  je     L20
  mov    -0x28(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <w_addword@plt>
  test   %rax,%rax
  je     L22
L20:
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <globfree@plt>
  mov    D36(%rip),%rax
  mov    (%rax),%eax
  jmp    L77
L22:
  addl   $0x1,-0x30(%rbp)
L128:
  mov    -0x20(%rbp),%eax
  cmp    %eax,-0x30(%rbp)
  jl     L14
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <globfree@plt>
  mov    $0x0,%eax
L77:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L29
  call   <__stack_chk_fail@plt>
L29:
  leave
  ret
```

assistant: ```c
int do_parse_glob(const char *glob_word, char **word, size_t *word_length, size_t *max_length, wordexp_t *pwordexp, const char *ifs) {
  int error;
  int match;
  glob_t globbuf;
  error = glob(glob_word, GLOB_NOCHECK, NULL, &globbuf);
  if (error != 0) {
    assert(error == GLOB_NOSPACE);
    return WRDE_NOSPACE;
  }
  if (ifs && !*ifs) {
    assert(globbuf.gl_pathv[0] != NULL);
    *word = w_addstr(*word, word_length, max_length, globbuf.gl_pathv[0]);
    for (match = 1; match < globbuf.gl_pathc && *word != NULL; ++match) {
      *word = w_addchar(*word, word_length, max_length, ' ');
      if (*word != NULL)
        *word = w_addstr(*word, word_length, max_length, globbuf.gl_pathv[match]);
    }
    globfree(&globbuf);
    return *word ? 0 : WRDE_NOSPACE;
  }
  assert(ifs == NULL || *ifs != '\0');
  if (*word != NULL) {
    free(*word);
    *word = w_newword(word_length, max_length);
  }
  for (match = 0; match < globbuf.gl_pathc; ++match) {
    char *matching_word = strdup(globbuf.gl_pathv[match]);
    if (matching_word == NULL || w_addword(pwordexp, matching_word)) {
      globfree(&globbuf);
      return WRDE_NOSPACE;
    }
  }
  globfree(&globbuf);
  return 0;
}
```