user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<get_full_path>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  movzbl (%rdi),%eax
  cmp    $0x7e,%al
  je     L311
  cmp    $0x2f,%al
  je     L327
L149:
  lea    D7(%rip),%rdi
  call   <getenv@plt>
  mov    %rax,%r13
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,%r12
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    0x2(%r12,%rax,1),%rdi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    %rbp,%rcx
  mov    %r13,%rdx
  lea    D3(%rip),%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
L201:
  mov    %r12,%rax
  jmp    L364
L311:
  cmpb   $0x2f,0x1(%rdi)
  jne    L149
  lea    D5(%rip),%rdi
  call   <getenv@plt>
  mov    %rax,%r13
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,%r12
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    0x1(%r12,%rax,1),%rdi
  call   <malloc@plt>
  mov    %rax,%r12
  lea    0x1(%rbp),%rcx
  mov    %r13,%rdx
  lea    D4(%rip),%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  jmp    L201
L327:
  call   <strlen@plt>
  lea    0x1(%rax),%rdi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    %rbp,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  jmp    L201
L62:
  cmpb   $0x2f,-0x1(%rax)
  jne    L183
  cmpb   $0x2e,(%rax)
  je     L265
  movzbl (%rax),%edx
  jmp    L383
L265:
  cmpb   $0x2f,0x2(%rax)
  je     L210
L281:
  mov    %rax,%rbx
  cmpb   $0x2f,-0x1(%rax)
  jne    L43
  cmp    $0x2f,%cl
  jne    L43
  lea    -0x1(%rax),%rbx
  lea    0x1(%rax),%rdx
  jmp    L286
L210:
  lea    -0x2(%rax),%rbx
  cmpb   $0x2f,-0x2(%rax)
  je     L274
  cmp    %rbx,%r12
  jae    L274
L38:
  sub    $0x1,%rbx
  cmpb   $0x2f,(%rbx)
  je     L274
  cmp    %rbx,%r12
  jb     L38
L274:
  cmp    %rbx,%r12
  ja     L66
  jne    L50
  movb   $0x2f,(%rbx)
  jmp    L50
L66:
  mov    %r12,%rbx
L50:
  lea    0x2(%rax),%rdx
  jmp    L286
L309:
  cmpb   $0x2f,-0x1(%rax)
  je     L276
L44:
  movzbl 0x1(%rax),%edx
  cmp    $0x2f,%dl
  je     L220
  test   %dl,%dl
  jne    L374
  movb   $0x0,(%rax)
  cmp    %rbx,%rax
  je     L196
  mov    %rax,%rdx
  jmp    L88
L276:
  lea    -0x1(%rax),%rbx
  mov    %rax,%rdx
L286:
  cmp    %rbx,%rdx
  je     L361
L88:
  mov    %rbx,%rax
L95:
  movzbl (%rdx),%ecx
  mov    %cl,(%rax)
  add    $0x1,%rax
  add    $0x1,%rdx
  cmpb   $0x0,(%rdx)
  jne    L95
  movb   $0x0,(%rax)
  jmp    L43
L391:
  cmpb   $0x2f,(%rax)
  je     L44
  mov    %rax,%rbx
L43:
  lea    0x1(%rbx),%rdx
  cmpb   $0x0,0x1(%rbx)
  je     L196
  cmp    %rdx,%r12
  ja     L196
  mov    %rax,%rbx
  mov    %rdx,%rax
L364:
  cmp    %rbp,%rax
  jbe    L391
  movzbl 0x1(%rax),%ecx
  cmp    $0x2e,%cl
  je     L62
L183:
  movzbl (%rax),%edx
  cmp    $0x2e,%dl
  je     L281
L383:
  cmp    $0x2f,%dl
  je     L309
  mov    %rax,%rbx
  jmp    L43
L220:
  mov    %rax,%rdx
L143:
  add    $0x1,%rdx
  cmpb   $0x2f,0x1(%rdx)
  je     L143
  mov    %rax,%rbx
  jmp    L286
L374:
  mov    %rax,%rbx
  jmp    L43
L361:
  mov    %rbx,%rax
  jmp    L43
L196:
  mov    %r12,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: parse_data
arguments: data_label: D7
type_infered: string
name: parse_data
arguments: data_label: D3
type_infered: string
name: parse_data
arguments: data_label: D5
type_infered: string
name: parse_data
arguments: data_label: D4
type_infered: string

tool: D7: PWD

tool: D3: %s/%s

tool: D5: HOME

tool: D4: %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;
}
```