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

```asm
<filesys_test_connect_directory>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x70,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  mov    $0x1,%edx
  lea    D56(%rip),%rsi
  mov    $0x0,%edi
  call   <filesys_open_directory@plt>
  test   %eax,%eax
  je     L15
  lea    D123(%rip),%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_connect_directory@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  lea    D104(%rip),%rbx
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  lea    D56(%rip),%rbp
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  sete   %dil
  movzbl %dil,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  lea    D75(%rip),%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_connect_directory@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  sete   %dil
  movzbl %dil,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  lea    D70(%rip),%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_connect_directory@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  lea    D107(%rip),%rbp
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  sete   %dil
  movzbl %dil,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  lea    D68(%rip),%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_connect_directory@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  sete   %dil
  movzbl %dil,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  lea    D18(%rip),%r14
  mov    %r14,%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_connect_directory@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  lea    D73(%rip),%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  sete   %dil
  movzbl %dil,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  mov    $0x1,%edx
  lea    D204(%rip),%r12
  mov    %r12,%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_open_directory@plt>
  lea    D96(%rip),%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_connect_directory@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  sete   %dil
  movzbl %dil,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  mov    $0x1,%edx
  lea    D195(%rip),%r13
  mov    %r13,%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_open_directory@plt>
  lea    D17(%rip),%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_connect_directory@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  sete   %dil
  movzbl %dil,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  lea    D207(%rip),%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_connect_directory@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  lea    D199(%rip),%rbp
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  sete   %dil
  movzbl %dil,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  mov    %r13,%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_connect_directory@plt>
  mov    %r14,%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_connect_directory@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  sete   %dil
  movzbl %dil,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  mov    $0x0,%edx
  lea    D50(%rip),%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_open_directory@plt>
  movslq %eax,%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_remove_directory@plt>
  mov    $0x1,%edx
  lea    D61(%rip),%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_open_directory@plt>
  lea    D120(%rip),%r12
  mov    %r12,%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_connect_directory@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_working_directory@plt>
  mov    %eax,%esi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  sete   %dil
  movzbl %dil,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  mov    %rbp,%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_connect_directory@plt>
  mov    $0x0,%edx
  lea    D116(%rip),%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_open_file@plt>
  movslq %eax,%rbx
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <assert@plt>
  mov    %rsp,%rdx
  mov    $0x64,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <file_read@plt>
  cmp    $0x64,%eax
  sete   %dil
  movzbl %dil,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <filesys_free@plt>
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  add    $0x70,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L15:
  lea    D169(%rip),%rdi
  call   <puts@plt>
  call   <abort@plt>
L4:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D56
data_type: string
name: unpack_data
arguments: label: D123
data_type: string
name: unpack_data
arguments: label: D104
data_type: string
name: unpack_data
arguments: label: D75
data_type: string
name: unpack_data
arguments: label: D70
data_type: string
name: unpack_data
arguments: label: D107
data_type: string
name: unpack_data
arguments: label: D68
data_type: string
name: unpack_data
arguments: label: D18
data_type: string
name: unpack_data
arguments: label: D73
data_type: string
name: unpack_data
arguments: label: D204
data_type: string
name: unpack_data
arguments: label: D96
data_type: string
name: unpack_data
arguments: label: D195
data_type: string
name: unpack_data
arguments: label: D17
data_type: string
name: unpack_data
arguments: label: D207
data_type: string
name: unpack_data
arguments: label: D199
data_type: string
name: unpack_data
arguments: label: D50
data_type: string
name: unpack_data
arguments: label: D61
data_type: string
name: unpack_data
arguments: label: D120
data_type: string
name: unpack_data
arguments: label: D116
data_type: string
name: unpack_data
arguments: label: D169
data_type: string

tool: D56: /a/b/c/d

tool: D123: a/b/c/d

tool: D104: dir: %s


tool: D75: .

tool: D70: ..

tool: D107: /a/b/c

tool: D68: ./

tool: D18: ../

tool: D73: /a/b

tool: D204: /a/e/f

tool: D96: ../e/g/../f

tool: D195: /a/e/f/k

tool: D17: k/

tool: D207: ../../../../../

tool: D199: /

tool: D50: /a

tool: D61: /1/2/3/4/5/6/

tool: D120: /1/2/3/4/5/6

tool: D116: data/debussy-logo.png

tool: D169: failed to create directory

assistant: ```c
void filesys_test_connect_directory() {
  struct filesystem *fs = (void *)0X0;
  struct directory *dir;
  if (!(dir = filesys_open_directory(fs, "/a/b/c/d", 1))) {
    printf("failed to create directory\n");
    abort();
  }
  filesys_connect_directory(fs, "a/b/c/d");
  printf("dir: %s\n", filesys_working_directory(fs));
  assert(!strcmp("/a/b/c/d", filesys_working_directory(fs)));
  filesys_connect_directory(fs, ".");
  printf("dir: %s\n", filesys_working_directory(fs));
  assert(!strcmp("/a/b/c/d", filesys_working_directory(fs)));
  filesys_connect_directory(fs, "..");
  printf("dir: %s\n", filesys_working_directory(fs));
  assert(!strcmp("/a/b/c", filesys_working_directory(fs)));
  filesys_connect_directory(fs, "./");
  printf("dir: %s\n", filesys_working_directory(fs));
  assert(!strcmp("/a/b/c", filesys_working_directory(fs)));
  filesys_connect_directory(fs, "../");
  printf("dir: %s\n", filesys_working_directory(fs));
  assert(!strcmp("/a/b", filesys_working_directory(fs)));
  filesys_open_directory(fs, "/a/e/f", 1);
  filesys_connect_directory(fs, "../e/g/../f");
  printf("dir: %s\n", filesys_working_directory(fs));
  assert(!strcmp("/a/e/f", filesys_working_directory(fs)));
  filesys_open_directory(fs, "/a/e/f/k", 1);
  filesys_connect_directory(fs, "k/");
  printf("dir: %s\n", filesys_working_directory(fs));
  assert(!strcmp("/a/e/f/k", filesys_working_directory(fs)));
  filesys_connect_directory(fs, "../../../../../");
  printf("dir: %s\n", filesys_working_directory(fs));
  assert(!strcmp("/", filesys_working_directory(fs)));
  filesys_connect_directory(fs, "/a/e/f/k");
  filesys_connect_directory(fs, "../");
  printf("dir: %s\n", filesys_working_directory(fs));
  assert(!strcmp("/a/e/f", filesys_working_directory(fs)));
  struct directory *dir2 = filesys_open_directory(fs, "/a", 0);
  filesys_remove_directory(fs, dir2);
  filesys_open_directory(fs, "/1/2/3/4/5/6/", 1);
  filesys_connect_directory(fs, "/1/2/3/4/5/6");
  printf("dir: %s\n", filesys_working_directory(fs));
  assert(!strcmp("/1/2/3/4/5/6", filesys_working_directory(fs)));
  filesys_connect_directory(fs, "/");
  struct file *f = filesys_open_file(fs, "data/debussy-logo.png", 0);
  assert(f);
  unsigned char buf[100];
  assert(100 == file_read(f, 100, buf));
  filesys_free(fs), free(fs);
}
```