user: 请将以下的汇编代码转换成C语言代码：

```asm
<fdt_get_path>:
  endbr64
  push   %r15
  mov    %ecx,%r15d
  push   %r14
  mov    %rdx,%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x28,%rsp
  mov    %ecx,0x4(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <fdt_check_header@plt>
  mov    %eax,(%rsp)
  test   %eax,%eax
  jne    L201
  cmp    $0x1,%r15d
  jle    L88
  movl   $0x0,0x10(%rsp)
  test   %ebx,%ebx
  js     L131
  lea    0x14(%rsp),%rax
  xor    %r13d,%r13d
  xor    %edx,%edx
  xor    %r15d,%r15d
  mov    %rax,0x8(%rsp)
  xor    %r12d,%r12d
L84:
  cmp    %r12d,%edx
  jle    L62
  nopl   (%rax)
L208:
  cmp    %ebx,%r13d
  je     L9
L24:
  mov    %r13d,%esi
  lea    0x10(%rsp),%rdx
  mov    %rbp,%rdi
  call   <fdt_next_node@plt>
  mov    %eax,%r13d
  test   %eax,%eax
  js     L0
  cmp    %eax,%ebx
  jl     L0
  mov    0x10(%rsp),%edx
  cmp    %edx,%r12d
  jle    L84
  nopl   (%rax)
L179:
  lea    -0x1(%r15),%eax
  cltq
  cs nopw 0x0(%rax,%rax,1)
L106:
  mov    %eax,%r15d
  sub    $0x1,%rax
  cmpb   $0x2f,(%r14,%rax,1)
  jne    L106
  sub    $0x1,%r12d
  cmp    %edx,%r12d
  jne    L179
  cmp    %r12d,%edx
  jg     L208
L62:
  mov    0x8(%rsp),%rdx
  mov    %r13d,%esi
  mov    %rbp,%rdi
  call   <fdt_get_name@plt>
  mov    %rax,%rsi
  test   %rax,%rax
  je     L70
  mov    0x14(%rsp),%edx
  lea    (%rdx,%r15,1),%eax
  cmp    0x4(%rsp),%eax
  jge    L208
  movslq %r15d,%rdi
  add    $0x1,%r12d
  add    %r14,%rdi
  call   <memcpy@plt>
  mov    0x14(%rsp),%eax
  add    %r15d,%eax
  lea    0x1(%rax),%r15d
  cltq
  movb   $0x2f,(%r14,%rax,1)
  cmp    %ebx,%r13d
  jne    L24
L9:
  cmp    %r12d,0x10(%rsp)
  jge    L88
  xor    %eax,%eax
  cmp    $0x1,%r15d
  setg   %al
  sub    %eax,%r15d
  movslq %r15d,%r15
  movb   $0x0,(%r14,%r15,1)
L201:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L33
  mov    (%rsp),%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L0:
  cmp    $0xffffffff,%r13d
  jge    L131
  cmp    $0xfffffffc,%r13d
  mov    $0xfffffff5,%r12d
  cmovne %r13d,%r12d
  mov    %r12d,(%rsp)
  jmp    L201
L70:
  mov    0x14(%rsp),%eax
  mov    %eax,(%rsp)
  jmp    L201
L33:
  call   <__stack_chk_fail@plt>
  nopl   0x0(%rax)
L131:
  movl   $0xfffffffc,(%rsp)
  jmp    L201
L88:
  movl   $0xfffffffd,(%rsp)
  jmp    L201
```

assistant: ```c
int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen) {
  int pdepth = 0, p = 0;
  int offset, depth, namelen;
  const char *name;
  {
    int __err;
    if ((__err = fdt_check_header(fdt)) != 0)
      return __err;
  };
  if (buflen < 2)
    return -3;
  for (offset = 0, depth = 0; (offset >= 0) && (offset <= nodeoffset); offset = fdt_next_node(fdt, offset, &depth)) {
    while (pdepth > depth) {
      do {
        p--;
      } while (buf[p - 1] != '/');
      pdepth--;
    }
    if (pdepth >= depth) {
      name = fdt_get_name(fdt, offset, &namelen);
      if (!name)
        return namelen;
      if ((p + namelen + 1) <= buflen) {
        memcpy(buf + p, name, namelen);
        p += namelen;
        buf[p++] = '/';
        pdepth++;
      }
    }
    if (offset == nodeoffset) {
      if (pdepth < (depth + 1))
        return -3;
      if (p > 1)
        p--;
      buf[p] = '\0';
      return 0;
    }
  }
  if ((offset == -1) || (offset >= 0))
    return -4;
  else if (offset == -4)
    return -11;
  return offset;
}
```