ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Converte this assembly snippet into its equivalent C code:

```asm
<fc_glob>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  add    $0x4,%rsi
  mov    $0x0,%r9d
  mov    $0x1,%r10d
L134:
  lea    -0x4(%rsi),%rbp
  mov    (%rdi),%eax
  cmp    $0x3f,%eax
  je     L234
  jg     L40
  test   %eax,%eax
  je     L164
  cmp    $0x2a,%eax
  jne    L19
  mov    $0x1,%edx
  cmpl   $0x0,0x4(%rdi)
  je     L125
  lea    0x4(%rdi),%rbx
  jmp    L223
L40:
  cmp    $0x5b,%eax
  jne    L19
  lea    0x4(%rdi),%rax
  mov    %r9d,%r8d
  cmpl   $0x5e,0x4(%rdi)
  je     L174
L233:
  mov    (%rax),%edx
  mov    -0x4(%rsi),%edi
  cmp    %edi,%edx
  sete   %cl
  movzbl %cl,%ecx
  cmp    %ecx,%r8d
  jne    L210
L7:
  test   %edx,%edx
  je     L111
  cmp    $0x5d,%edx
  je     L111
  add    $0x4,%rax
  mov    (%rax),%edx
  cmp    %edi,%edx
  sete   %cl
  movzbl %cl,%ecx
  cmp    %r8d,%ecx
  je     L7
L210:
  mov    %rax,%rdi
  add    $0x4,%rax
  mov    -0x4(%rax),%edx
  test   %edx,%edx
  je     L125
  cmpl   $0x5d,(%rax)
  jne    L210
  add    $0x8,%rdi
  jmp    L222
L164:
  cmpl   $0x0,0x0(%rbp)
  sete   %dl
  movzbl %dl,%edx
L125:
  mov    %edx,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L234:
  mov    -0x4(%rsi),%edx
  test   %edx,%edx
  je     L125
  add    $0x4,%rdi
L222:
  add    $0x4,%rsi
  jmp    L134
L65:
  add    $0x4,%rbp
  mov    -0x4(%rbp),%edx
  test   %edx,%edx
  je     L125
L223:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <fc_glob>
  test   %eax,%eax
  je     L65
  mov    $0x1,%edx
  jmp    L125
L174:
  lea    0x8(%rdi),%rax
  mov    %r10d,%r8d
  jmp    L233
L19:
  add    $0x4,%rdi
  cmp    -0x4(%rsi),%eax
  je     L222
  mov    $0x0,%edx
  jmp    L125
L111:
  mov    $0x0,%edx
  jmp    L125
```

assistant: ```c
bool fc_glob(const char32_t *pat, const char32_t *str) {
  for (;;) {
    switch (*pat) {
    case U'\0':
      return !*str;
      break;
    case U'?':
      if (!*str++)
        return false;
      pat++;
      break;
    case U'*':
      if (!*++pat)
        return true;
      do {
        if (fc_glob(pat, str))
          return true;
      } while (*str++);
      return false;
      break;
    case U'[': {
      bool invert = false;
      pat++;
      if (*pat == U'^') {
        invert = true;
        pat++;
      }
      while ((*pat == *str) == invert) {
        if (!*pat || *pat == U']')
          return false;
        pat++;
      }
      do {
        if (!*pat++)
          return false;
      } while (*pat != U']');
      pat++;
      str++;
      break;
    }
    default:
      if (*str++ != *pat++)
        return false;
      break;
    }
  }
  return false;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<fc_glob>:
  endbr64
  push   %rbp
  add    $0x4,%rsi
  push   %rbx
  lea    -0x4(%rsi),%rbp
  sub    $0x8,%rsp
  mov    (%rdi),%eax
  cmp    $0x3f,%eax
  je     L148
L27:
  jg     L193
  test   %eax,%eax
  je     L231
  cmp    $0x2a,%eax
  jne    L13
  mov    0x4(%rdi),%edx
  mov    $0x1,%eax
  test   %edx,%edx
  je     L204
  lea    0x4(%rdi),%rbx
L221:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <fc_glob>
  test   %eax,%eax
  jne    L118
  mov    0x0(%rbp),%eax
  add    $0x4,%rbp
  test   %eax,%eax
  jne    L221
L204:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L193:
  cmp    $0x5b,%eax
  jne    L13
  mov    0x4(%rdi),%eax
  lea    0x4(%rdi),%rdx
  xor    %r8d,%r8d
  cmp    $0x5e,%eax
  je     L38
L205:
  mov    -0x4(%rsi),%edi
  xor    %ecx,%ecx
  cmp    %eax,%edi
  sete   %cl
  cmp    %r8d,%ecx
  jne    L24
  nop
L106:
  test   %eax,%eax
  je     L228
  cmp    $0x5d,%eax
  je     L228
  mov    0x4(%rdx),%eax
  add    $0x4,%rdx
  xor    %ecx,%ecx
  cmp    %edi,%eax
  sete   %cl
  cmp    %r8d,%ecx
  je     L106
  mov    %rdx,%rdi
  add    $0x4,%rdx
  test   %eax,%eax
  je     L204
  nop
L122:
  mov    (%rdx),%eax
  cmp    $0x5d,%eax
  je     L208
L24:
  mov    %rdx,%rdi
  add    $0x4,%rdx
  test   %eax,%eax
  jne    L122
  jmp    L204
  nopl   0x0(%rax,%rax,1)
L13:
  add    $0x4,%rdi
  cmp    -0x4(%rsi),%eax
  jne    L228
L17:
  mov    (%rdi),%eax
  add    $0x4,%rsi
  lea    -0x4(%rsi),%rbp
  cmp    $0x3f,%eax
  jne    L27
L148:
  mov    -0x4(%rsi),%eax
  test   %eax,%eax
  je     L204
  add    $0x4,%rdi
  jmp    L17
  nopl   (%rax)
L231:
  mov    0x0(%rbp),%ecx
  xor    %eax,%eax
  test   %ecx,%ecx
  sete   %al
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L38:
  mov    0x8(%rdi),%eax
  lea    0x8(%rdi),%rdx
  mov    $0x1,%r8d
  jmp    L205
  nopw   0x0(%rax,%rax,1)
L228:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L118:
  mov    $0x1,%eax
  jmp    L204
  nopw   0x0(%rax,%rax,1)
L208:
  add    $0x8,%rdi
  jmp    L17
```

assistant: ```c
bool fc_glob(const char32_t *pat, const char32_t *str) {
  for (;;) {
    switch (*pat) {
    case U'\0':
      return !*str;
      break;
    case U'?':
      if (!*str++)
        return false;
      pat++;
      break;
    case U'*':
      if (!*++pat)
        return true;
      do {
        if (fc_glob(pat, str))
          return true;
      } while (*str++);
      return false;
      break;
    case U'[': {
      bool invert = false;
      pat++;
      if (*pat == U'^') {
        invert = true;
        pat++;
      }
      while ((*pat == *str) == invert) {
        if (!*pat || *pat == U']')
          return false;
        pat++;
      }
      do {
        if (!*pat++)
          return false;
      } while (*pat != U']');
      pat++;
      str++;
      break;
    }
    default:
      if (*str++ != *pat++)
        return false;
      break;
    }
  }
  return false;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<fc_glob>:
  endbr64
  push   %rbp
  add    $0x4,%rsi
  push   %rbx
  lea    -0x4(%rsi),%rbp
  sub    $0x8,%rsp
  mov    (%rdi),%eax
  cmp    $0x3f,%eax
  je     L11
L236:
  jg     L3
  test   %eax,%eax
  je     L98
  cmp    $0x2a,%eax
  jne    L65
  mov    0x4(%rdi),%eax
  mov    $0x1,%r8d
  test   %eax,%eax
  je     L215
  lea    0x4(%rdi),%rbx
L189:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <fc_glob>
  test   %eax,%eax
  jne    L125
  mov    0x0(%rbp),%r8d
  add    $0x4,%rbp
  test   %r8d,%r8d
  jne    L189
L215:
  add    $0x8,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L3:
  cmp    $0x5b,%eax
  jne    L65
  mov    0x4(%rdi),%edx
  lea    0x4(%rdi),%rax
  xor    %r8d,%r8d
  cmp    $0x5e,%edx
  je     L133
L187:
  mov    -0x4(%rsi),%edi
  xor    %ecx,%ecx
  cmp    %edx,%edi
  sete   %cl
  cmp    %r8d,%ecx
  jne    L114
  nopl   0x0(%rax,%rax,1)
L42:
  test   %edx,%edx
  je     L26
  cmp    $0x5d,%edx
  je     L26
  mov    0x4(%rax),%edx
  add    $0x4,%rax
  xor    %ecx,%ecx
  cmp    %edi,%edx
  sete   %cl
  cmp    %r8d,%ecx
  je     L42
  mov    %rax,%rdi
  mov    (%rax),%r8d
  add    $0x4,%rax
  test   %r8d,%r8d
  je     L215
  nopl   0x0(%rax,%rax,1)
L62:
  cmpl   $0x5d,(%rax)
  je     L148
L114:
  mov    %rax,%rdi
  mov    (%rax),%r8d
  add    $0x4,%rax
  test   %r8d,%r8d
  jne    L62
  jmp    L215
  nopl   (%rax)
L65:
  add    $0x4,%rdi
  cmp    -0x4(%rsi),%eax
  jne    L26
L43:
  mov    (%rdi),%eax
  add    $0x4,%rsi
  lea    -0x4(%rsi),%rbp
  cmp    $0x3f,%eax
  jne    L236
L11:
  mov    -0x4(%rsi),%r8d
  test   %r8d,%r8d
  je     L215
  add    $0x4,%rdi
  jmp    L43
  nopw   0x0(%rax,%rax,1)
L98:
  mov    0x0(%rbp),%edx
  xor    %r8d,%r8d
  test   %edx,%edx
  sete   %r8b
  add    $0x8,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  ret
  cs nopw 0x0(%rax,%rax,1)
L133:
  mov    0x8(%rdi),%edx
  lea    0x8(%rdi),%rax
  mov    $0x1,%r8d
  jmp    L187
  nopw   0x0(%rax,%rax,1)
L26:
  add    $0x8,%rsp
  xor    %r8d,%r8d
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L125:
  mov    $0x1,%r8d
  jmp    L215
  nopl   0x0(%rax,%rax,1)
L148:
  add    $0x8,%rdi
  jmp    L43
```

assistant: ```c
bool fc_glob(const char32_t *pat, const char32_t *str) {
  for (;;) {
    switch (*pat) {
    case U'\0':
      return !*str;
      break;
    case U'?':
      if (!*str++)
        return false;
      pat++;
      break;
    case U'*':
      if (!*++pat)
        return true;
      do {
        if (fc_glob(pat, str))
          return true;
      } while (*str++);
      return false;
      break;
    case U'[': {
      bool invert = false;
      pat++;
      if (*pat == U'^') {
        invert = true;
        pat++;
      }
      while ((*pat == *str) == invert) {
        if (!*pat || *pat == U']')
          return false;
        pat++;
      }
      do {
        if (!*pat++)
          return false;
      } while (*pat != U']');
      pat++;
      str++;
      break;
    }
    default:
      if (*str++ != *pat++)
        return false;
      break;
    }
  }
  return false;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<nftw>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  mov    %ecx,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    D36(%rip),%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x30(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  movslq %eax,%rdx
  mov    %rdx,%r8
  mov    $0x0,%r9d
  cltq
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L13:
  cmp    %rdx,%rsp
  je     L70
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L13
L70:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L73
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L73:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x28(%rbp)
  cmpl   $0x0,-0x44(%rbp)
  jg     L10
  mov    $0x0,%eax
  jmp    L34
L10:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x20(%rbp)
  mov    D36(%rip),%rax
  mov    (%rax),%eax
  cltq
  cmp    %rax,-0x20(%rbp)
  jbe    L36
  mov    D19(%rip),%rax
  mov    (%rax),%edx
  mov    D4(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L34
L36:
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x48(%rbp),%ecx
  mov    -0x44(%rbp),%edx
  mov    -0x40(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    $0x0,%r8d
  mov    %rax,%rdi
  call   <do_nftw@plt>
L34:
  mov    %rbx,%rsp
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L64
  call   <__stack_chk_fail@plt>
L64:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int nftw(const char *path, int (*fn)(const char *, const struct stat *, int, struct FTW *), int fd_limit, int flags) {
  size_t l;
  char pathbuf[PATH_MAX + 1];
  if (fd_limit <= 0)
    return 0;
  l = strlen(path);
  if (l > PATH_MAX) {
    errno = ENAMETOOLONG;
    return -1;
  }
  memcpy(pathbuf, path, l + 1);
  return do_nftw(pathbuf, fn, fd_limit, flags, NULL);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<nftw>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbx
  mov    %rsi,-0x48(%rbp)
  mov    %edx,%r13d
  mov    %ecx,%r14d
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    D26(%rip),%rax
  mov    (%rax),%r12d
  lea    0x1(%r12),%eax
  cltq
  add    $0xf,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L43:
  cmp    %rdx,%rsp
  je     L37
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L43
L37:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L68
  orq    $0x0,-0x8(%rsp,%rax,1)
L68:
  mov    %rsp,%r15
  mov    $0x0,%eax
  test   %r13d,%r13d
  jle    L21
  mov    %rbx,%rdi
  call   <strlen@plt>
  movslq %r12d,%r12
  cmp    %rax,%r12
  jb     L48
  lea    0x1(%rax),%rdx
  mov    %rbx,%rsi
  mov    %r15,%rdi
  call   <memcpy@plt>
  mov    $0x0,%r8d
  mov    %r14d,%ecx
  mov    %r13d,%edx
  mov    -0x48(%rbp),%rsi
  mov    %r15,%rdi
  call   <do_nftw@plt>
L21:
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L64
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L48:
  mov    D1(%rip),%rax
  mov    (%rax),%edx
  mov    D10(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L21
L64:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int nftw(const char *path, int (*fn)(const char *, const struct stat *, int, struct FTW *), int fd_limit, int flags) {
  size_t l;
  char pathbuf[PATH_MAX + 1];
  if (fd_limit <= 0)
    return 0;
  l = strlen(path);
  if (l > PATH_MAX) {
    errno = ENAMETOOLONG;
    return -1;
  }
  memcpy(pathbuf, path, l + 1);
  return do_nftw(pathbuf, fn, fd_limit, flags, NULL);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<nftw>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  mov    %rdi,%r15
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %edx,%r12d
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  mov    D17(%rip),%rax
  mov    %rsp,%rcx
  movslq (%rax),%rbx
  lea    0x1(%rbx),%eax
  cltq
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L0
L48:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L48
L0:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L75
L74:
  xor    %eax,%eax
  test   %r12d,%r12d
  jle    L12
  mov    %r15,%rdi
  call   <strlen@plt>
  cmp    %rax,%rbx
  jb     L41
  lea    0x1(%rax),%rdx
  mov    %r15,%rsi
  mov    %rsp,%rdi
  call   <memcpy@plt>
  xor    %r8d,%r8d
  mov    %r14d,%ecx
  mov    %r12d,%edx
  mov    %r13,%rsi
  mov    %rsp,%rdi
  call   <do_nftw@plt>
L12:
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L30
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   0x0(%rax)
L75:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L74
L41:
  mov    D28(%rip),%rax
  mov    (%rax),%edx
  mov    D23(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L12
L30:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int nftw(const char *path, int (*fn)(const char *, const struct stat *, int, struct FTW *), int fd_limit, int flags) {
  size_t l;
  char pathbuf[PATH_MAX + 1];
  if (fd_limit <= 0)
    return 0;
  l = strlen(path);
  if (l > PATH_MAX) {
    errno = ENAMETOOLONG;
    return -1;
  }
  memcpy(pathbuf, path, l + 1);
  return do_nftw(pathbuf, fn, fd_limit, flags, NULL);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<nftw>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  mov    %rdi,%r15
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %edx,%r12d
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  mov    D15(%rip),%rax
  mov    %rsp,%rcx
  movslq (%rax),%rbx
  lea    0x1(%rbx),%eax
  cltq
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L11
L41:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L41
L11:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L20
L50:
  xor    %eax,%eax
  test   %r12d,%r12d
  jle    L38
  mov    %r15,%rdi
  call   <strlen@plt>
  cmp    %rax,%rbx
  jb     L40
  lea    0x1(%rax),%rdx
  mov    %r15,%rsi
  mov    %rsp,%rdi
  call   <memcpy@plt>
  xor    %r8d,%r8d
  mov    %r14d,%ecx
  mov    %r12d,%edx
  mov    %r13,%rsi
  mov    %rsp,%rdi
  call   <do_nftw@plt>
L38:
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L71
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   0x0(%rax)
L20:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L50
L40:
  mov    D9(%rip),%rax
  mov    (%rax),%edx
  mov    D10(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L38
L71:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int nftw(const char *path, int (*fn)(const char *, const struct stat *, int, struct FTW *), int fd_limit, int flags) {
  size_t l;
  char pathbuf[PATH_MAX + 1];
  if (fd_limit <= 0)
    return 0;
  l = strlen(path);
  if (l > PATH_MAX) {
    errno = ENAMETOOLONG;
    return -1;
  }
  memcpy(pathbuf, path, l + 1);
  return do_nftw(pathbuf, fn, fd_limit, flags, NULL);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<setNextHttpHeaderName>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L1
L40:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L19
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  jne    L35
L19:
  mov    -0x28(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x10(%rbp),%rax
  sub    -0x8(%rbp),%rax
  jmp    L61
L35:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xd,%al
  je     L38
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L49
L38:
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x8(%rbp)
L49:
  addq   $0x1,-0x10(%rbp)
L1:
  mov    -0x10(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jbe    L40
  mov    $0x0,%eax
L61:
  pop    %rbp
  ret
```

assistant: ```c
int setNextHttpHeaderName(const char *start, const char *end, char **name) {
  char *current = (char *)start, *lastChar = (char *)start;
  while (current <= end) {
    if (*current == ' ' || *current == ':') {
      *name = lastChar;
      return (int)(current - lastChar);
    }
    if (*current == '\r' || *current == '\n') {
      lastChar = current + 1;
    }
    current++;
  }
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<setNextHttpHeaderName>:
  endbr64
  cmp    %rsi,%rdi
  ja     L12
  mov    %rdi,%rcx
  jmp    L8
L42:
  mov    %rcx,(%rdx)
  mov    %edi,%eax
  sub    %ecx,%eax
  ret
L68:
  lea    0x1(%rdi),%rcx
L45:
  add    $0x1,%rdi
  cmp    %rdi,%rsi
  jb     L20
L8:
  movzbl (%rdi),%eax
  cmp    $0x20,%al
  je     L42
  cmp    $0x3a,%al
  je     L42
  cmp    $0xd,%al
  je     L68
  cmp    $0xa,%al
  jne    L45
  jmp    L68
L20:
  mov    $0x0,%eax
  ret
L12:
  mov    $0x0,%eax
  ret
```

assistant: ```c
int setNextHttpHeaderName(const char *start, const char *end, char **name) {
  char *current = (char *)start, *lastChar = (char *)start;
  while (current <= end) {
    if (*current == ' ' || *current == ':') {
      *name = lastChar;
      return (int)(current - lastChar);
    }
    if (*current == '\r' || *current == '\n') {
      lastChar = current + 1;
    }
    current++;
  }
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<setNextHttpHeaderName>:
  endbr64
  cmp    %rsi,%rdi
  ja     L55
  mov    %rdi,%rcx
  jmp    L34
  xchg   %ax,%ax
L67:
  cmp    %rdi,%rsi
  jb     L55
L34:
  movzbl (%rdi),%eax
  cmp    $0x20,%al
  je     L70
  cmp    $0x3a,%al
  je     L70
  add    $0x1,%rdi
  cmp    $0xd,%al
  je     L6
  cmp    $0xa,%al
  jne    L67
L6:
  mov    %rdi,%rcx
  cmp    %rdi,%rsi
  jae    L34
L55:
  xor    %eax,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L70:
  mov    %edi,%eax
  mov    %rcx,(%rdx)
  sub    %ecx,%eax
  ret
```

assistant: ```c
int setNextHttpHeaderName(const char *start, const char *end, char **name) {
  char *current = (char *)start, *lastChar = (char *)start;
  while (current <= end) {
    if (*current == ' ' || *current == ':') {
      *name = lastChar;
      return (int)(current - lastChar);
    }
    if (*current == '\r' || *current == '\n') {
      lastChar = current + 1;
    }
    current++;
  }
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<setNextHttpHeaderName>:
  endbr64
  cmp    %rsi,%rdi
  ja     L11
  mov    %rdi,%rcx
  jmp    L41
  xchg   %ax,%ax
L35:
  cmp    %rdi,%rsi
  jb     L11
L41:
  movzbl (%rdi),%eax
  cmp    $0x20,%al
  je     L75
  cmp    $0x3a,%al
  je     L75
  add    $0x1,%rdi
  cmp    $0xd,%al
  je     L1
  cmp    $0xa,%al
  jne    L35
L1:
  mov    %rdi,%rcx
  cmp    %rdi,%rsi
  jae    L41
L11:
  xor    %eax,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L75:
  mov    %edi,%eax
  mov    %rcx,(%rdx)
  sub    %ecx,%eax
  ret
```

assistant: ```c
int setNextHttpHeaderName(const char *start, const char *end, char **name) {
  char *current = (char *)start, *lastChar = (char *)start;
  while (current <= end) {
    if (*current == ' ' || *current == ':') {
      *name = lastChar;
      return (int)(current - lastChar);
    }
    if (*current == '\r' || *current == '\n') {
      lastChar = current + 1;
    }
    current++;
  }
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<display_matrix>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8,-0x38(%rbp)
  mov    %r9,-0x40(%rbp)
  cmpq   $0x0,0x10(%rbp)
  je     L39
  mov    0x10(%rbp),%rdi
  call   <puts@plt>
L39:
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L5
L15:
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L13
L7:
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x40(%rbp),%rax
  movd   %edx,%xmm0
  mov    %rax,%rdi
  call   <printf@plt>
  addq   $0x1,-0x8(%rbp)
L13:
  mov    -0x8(%rbp),%rax
  cmp    -0x38(%rbp),%rax
  jle    L7
  mov    $0xa,%edi
  call   <putchar@plt>
  addq   $0x1,-0x10(%rbp)
L5:
  mov    -0x10(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jle    L15
  nop
  nop
  leave
  ret
```

assistant: ```c
void display_matrix(float **m, long nrl, long nrh, long ncl, long nch, char *format, char *name) {
  long i, j;
  if (name != NULL)
    puts(name);
  for (i = nrl; i <= nrh; i++) {
    for (j = ncl; j <= nch; j++) {
      printf(format, m[i][j]);
    }
    putchar('\n');
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<display_matrix>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r14
  mov    %rdx,0x8(%rsp)
  mov    %rcx,%r15
  mov    %r8,%r12
  mov    %r9,%r13
  mov    0x50(%rsp),%rdi
  test   %rdi,%rdi
  je     L47
  call   <puts@plt>
L47:
  cmp    0x8(%rsp),%r14
  jg     L29
  lea    (%rbx,%r14,8),%rbp
  jmp    L22
L38:
  mov    0x0(%rbp),%rax
  movss  (%rax,%rbx,4),%xmm0
  mov    %r13,%rdi
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    %rbx,%r12
  jge    L38
L59:
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x1,%r14
  add    $0x8,%rbp
  cmp    %r14,0x8(%rsp)
  jl     L29
L22:
  mov    %r15,%rbx
  cmp    %r12,%r15
  jle    L38
  jmp    L59
L29:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void display_matrix(float **m, long nrl, long nrh, long ncl, long nch, char *format, char *name) {
  long i, j;
  if (name != NULL)
    puts(name);
  for (i = nrl; i <= nrh; i++) {
    for (j = ncl; j <= nch; j++) {
      printf(format, m[i][j]);
    }
    putchar('\n');
  }
}
```