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

```asm
<get_full_path>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  movzbl (%rdi),%eax
  cmp    $0x7e,%al
  je     L5
  cmp    $0x2f,%al
  je     L177
L89:
  lea    D6(%rip),%rdi
  call   <getenv@plt>
  mov    %rax,%rdi
  mov    %rax,%r13
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %rax,%r12
  call   <strlen@plt>
  lea    0x2(%r12,%rax,1),%rdi
  call   <malloc@plt>
  mov    %rbp,%rcx
  mov    %r13,%rdx
  lea    D10(%rip),%rsi
  mov    %rax,%rdi
  mov    %rax,%r12
  call   <sprintf@plt>
L230:
  movzbl (%r12),%edx
  mov    %r12,%rcx
L387:
  movzbl 0x1(%rcx),%esi
  cmp    %rbp,%rcx
  jbe    L42
  cmp    $0x2e,%sil
  je     L197
L398:
  cmp    $0x2e,%dl
  je     L182
  cmp    $0x2f,%dl
  jne    L117
  cmpb   $0x2f,-0x1(%rcx)
  je     L47
L98:
  cmp    $0x2f,%sil
  je     L7
  test   %sil,%sil
  jne    L117
  movb   $0x0,(%rcx)
  cmp    %rbx,%rcx
  je     L32
  mov    %rcx,%rax
  mov    %rbx,%rsi
  lea    0x1(%rbx),%rcx
L221:
  mov    %rsi,%rbx
  nop
L240:
  movzbl (%rax),%edx
  add    $0x1,%rax
  add    $0x1,%rbx
  mov    %dl,-0x1(%rbx)
  cmpb   $0x0,(%rax)
  jne    L240
  movb   $0x0,(%rbx)
  movzbl 0x1(%rsi),%edx
L122:
  cmp    %rcx,%r12
  ja     L32
  test   %dl,%dl
  jne    L387
L32:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L42:
  cmp    $0x2f,%dl
  je     L98
L117:
  mov    %rcx,%rbx
  mov    %esi,%edx
  add    $0x1,%rcx
  jmp    L122
  nopl   0x0(%rax,%rax,1)
L197:
  cmpb   $0x2f,-0x1(%rcx)
  jne    L398
  cmp    $0x2e,%dl
  je     L17
  cmp    $0x2f,%dl
  jne    L117
L47:
  lea    -0x1(%rcx),%rsi
  mov    %rcx,%rax
L145:
  cmp    %rsi,%rax
  jne    L221
  movzbl 0x1(%rax),%edx
  mov    %rax,%rbx
  jmp    L122
  nopl   (%rax)
L182:
  cmpb   $0x2f,-0x1(%rcx)
  lea    0x1(%rcx),%rax
  je     L8
L357:
  mov    %rcx,%rbx
  mov    %esi,%edx
  mov    %rax,%rcx
  jmp    L122
L177:
  call   <strlen@plt>
  lea    0x1(%rax),%rdi
  call   <malloc@plt>
  mov    %rbp,%rsi
  mov    %rax,%rdi
  mov    %rax,%r12
  call   <strcpy@plt>
  jmp    L230
  nopl   (%rax)
L7:
  mov    %rcx,%rax
  nopl   0x0(%rax,%rax,1)
L53:
  add    $0x1,%rax
  cmpb   $0x2f,0x1(%rax)
  je     L53
  mov    %rcx,%rsi
  add    $0x1,%rcx
  jmp    L145
L8:
  cmp    $0x2f,%sil
  jne    L357
  lea    -0x1(%rcx),%rsi
  jmp    L145
L5:
  cmpb   $0x2f,0x1(%rdi)
  jne    L89
  lea    D24(%rip),%rdi
  call   <getenv@plt>
  mov    %rax,%rdi
  mov    %rax,%r13
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %rax,%r12
  call   <strlen@plt>
  lea    0x1(%r12,%rax,1),%rdi
  call   <malloc@plt>
  lea    0x1(%rbp),%rcx
  mov    %r13,%rdx
  lea    D20(%rip),%rsi
  mov    %rax,%rdi
  mov    %rax,%r12
  call   <sprintf@plt>
  jmp    L230
L17:
  cmpb   $0x2f,0x2(%rcx)
  je     L213
  mov    %rcx,%rbx
  add    $0x1,%rcx
  jmp    L122
L213:
  cmpb   $0x2f,-0x2(%rcx)
  lea    -0x2(%rcx),%rsi
  jne    L363
  jmp    L105
  nopl   0x0(%rax)
L255:
  sub    $0x1,%rsi
  cmpb   $0x2f,(%rsi)
  je     L105
L363:
  cmp    %rsi,%r12
  jb     L255
L105:
  cmp    %rsi,%r12
  ja     L232
  je     L316
L281:
  lea    0x2(%rcx),%rax
  lea    0x1(%rsi),%rcx
  jmp    L145
L232:
  mov    %r12,%rsi
  jmp    L281
L316:
  movb   $0x2f,(%r12)
  jmp    L281
```

tool_calls: name: extract_symbolic_data
arguments: label: D6
type_infered: string
name: extract_symbolic_data
arguments: label: D10
type_infered: string
name: extract_symbolic_data
arguments: label: D24
type_infered: string
name: extract_symbolic_data
arguments: label: D20
type_infered: string

tool: D6: PWD

tool: D10: %s/%s

tool: D24: HOME

tool: D20: %s%s

assistant: ```c
char *get_full_path(char *ipath) {
  char *i, *j, *k;
  char *opath, *tmp;
  if (*ipath == '~' && *(ipath + 1) == '/') {
    tmp = getenv("HOME");
    opath = (char *)malloc(strlen(tmp) + strlen(ipath) + 1);
    sprintf(opath, "%s%s", tmp, ipath + 1);
  } else if (*ipath != '/') {
    tmp = getenv("PWD");
    opath = (char *)malloc(strlen(tmp) + strlen(ipath) + 2);
    sprintf(opath, "%s/%s", tmp, ipath);
  } else {
    opath = (char *)malloc(strlen(ipath) + 1);
    strcpy(opath, ipath);
  }
  i = opath;
  do {
    if (i > ipath && *(i + 1) == '.' && *(i - 1) == '/' && *i == '.' && *(i + 2) == '/') {
      j = i - 2;
      while (*j != '/' && j > opath) {
        j--;
      };
      if (j < opath) {
        j = opath;
      } else if (j == opath) {
        *j = '/';
      }
      i += 2;
    } else if (i > ipath && *i == '.' && *(i - 1) == '/' && *(i + 1) == '/') {
      j = i - 1;
      i += 1;
    } else if (i > ipath && *i == '/' && *(i - 1) == '/') {
      j = i - 1;
    } else if (*i == '/' && *(i + 1) == '/') {
      j = i;
      while (*(i + 1) == '/') {
        i += 1;
      }
    } else if (*i == '/' && *(i + 1) == '\0') {
      *i = '\0';
    } else {
      j = i;
    }
    if (i != j) {
      k = j;
      do {
        *j = *i;
        j++;
        i++;
      } while (*i != '\0');
      *j = '\0';
      i = k;
    }
    i++;
  } while (*i != '\0' && i >= opath);
  return opath;
}
```