user: Demonstrate the C code that generates the assembly output below:

```asm
<dir_info>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xb0,%rsp
  mov    %edi,-0xa4(%rbp)
  mov    %rsi,-0xb0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x94(%rbp),%rsi
  mov    -0xb0(%rbp),%rax
  mov    $0x0,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    %rax,%rdi
  call   <open_master_conn@plt>
  mov    %eax,-0x90(%rbp)
  cmpl   $0x0,-0x90(%rbp)
  jns    L267
  mov    $0xffffffff,%eax
  jmp    L281
L267:
  lea    -0x50(%rbp),%rax
  mov    %rax,-0x68(%rbp)
  lea    -0x68(%rbp),%rax
  mov    $0x1ce,%esi
  mov    %rax,%rdi
  call   <put32bit@plt>
  lea    -0x68(%rbp),%rax
  mov    $0x8,%esi
  mov    %rax,%rdi
  call   <put32bit@plt>
  lea    -0x68(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <put32bit@plt>
  mov    -0x94(%rbp),%edx
  lea    -0x68(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <put32bit@plt>
  lea    -0x50(%rbp),%rsi
  mov    -0x90(%rbp),%eax
  mov    $0x2710,%ecx
  mov    $0x10,%edx
  mov    %eax,%edi
  call   <tcptowrite@plt>
  cmp    $0x10,%eax
  je     L27
  mov    -0xb0(%rbp),%rax
  mov    %rax,%rsi
  lea    D53(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <close_master_conn@plt>
  mov    $0xffffffff,%eax
  jmp    L281
L27:
  lea    -0x50(%rbp),%rsi
  mov    -0x90(%rbp),%eax
  mov    $0x2710,%ecx
  mov    $0x8,%edx
  mov    %eax,%edi
  call   <tcptoread@plt>
  cmp    $0x8,%eax
  je     L99
  mov    -0xb0(%rbp),%rax
  mov    %rax,%rsi
  lea    D99(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <close_master_conn@plt>
  mov    $0xffffffff,%eax
  jmp    L281
L99:
  lea    -0x50(%rbp),%rax
  mov    %rax,-0x60(%rbp)
  lea    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <get32bit@plt>
  mov    %eax,-0x8c(%rbp)
  lea    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <get32bit@plt>
  mov    %eax,-0x88(%rbp)
  cmpl   $0x1cf,-0x8c(%rbp)
  je     L224
  mov    -0xb0(%rbp),%rax
  mov    %rax,%rsi
  lea    D104(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <close_master_conn@plt>
  mov    $0xffffffff,%eax
  jmp    L281
L224:
  mov    -0x88(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x58(%rbp)
  mov    -0x88(%rbp),%edx
  mov    -0x58(%rbp),%rsi
  mov    -0x90(%rbp),%eax
  mov    $0x2710,%ecx
  mov    %eax,%edi
  call   <tcptoread@plt>
  cmp    %eax,-0x88(%rbp)
  je     L272
  mov    -0xb0(%rbp),%rax
  mov    %rax,%rsi
  lea    D99(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x1,%edi
  call   <close_master_conn@plt>
  mov    $0xffffffff,%eax
  jmp    L281
L272:
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x60(%rbp)
  lea    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <get32bit@plt>
  mov    %eax,-0x8c(%rbp)
  cmpl   $0x0,-0x8c(%rbp)
  je     L276
  mov    -0xb0(%rbp),%rax
  mov    %rax,%rsi
  lea    D194(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x1,%edi
  call   <close_master_conn@plt>
  mov    $0xffffffff,%eax
  jmp    L281
L276:
  subl   $0x4,-0x88(%rbp)
  cmpl   $0x1,-0x88(%rbp)
  jne    L55
  mov    -0x60(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <mfsstrerr@plt>
  mov    %rax,%rdx
  mov    -0xb0(%rbp),%rax
  mov    %rax,%rsi
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x1,%edi
  call   <close_master_conn@plt>
  mov    $0xffffffff,%eax
  jmp    L281
L55:
  cmpl   $0x38,-0x88(%rbp)
  je     L166
  cmpl   $0x28,-0x88(%rbp)
  je     L166
  mov    -0xb0(%rbp),%rax
  mov    %rax,%rsi
  lea    D187(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x1,%edi
  call   <close_master_conn@plt>
  mov    $0xffffffff,%eax
  jmp    L281
L166:
  mov    $0x0,%edi
  call   <close_master_conn@plt>
  lea    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <get32bit@plt>
  mov    %eax,-0x84(%rbp)
  lea    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <get32bit@plt>
  mov    %eax,-0x80(%rbp)
  lea    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <get32bit@plt>
  mov    %eax,-0x7c(%rbp)
  cmpl   $0x38,-0x88(%rbp)
  jne    L268
  mov    -0x60(%rbp),%rax
  add    $0x20,%rax
  mov    %rax,-0x60(%rbp)
L268:
  lea    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <get32bit@plt>
  mov    %eax,-0x78(%rbp)
  cmpl   $0x38,-0x88(%rbp)
  jne    L49
  mov    -0x60(%rbp),%rax
  add    $0x20,%rax
  mov    %rax,-0x60(%rbp)
L49:
  lea    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <get64bit@plt>
  mov    %eax,-0x74(%rbp)
  lea    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <get64bit@plt>
  mov    %eax,-0x70(%rbp)
  lea    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <get64bit@plt>
  mov    %eax,-0x6c(%rbp)
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  cmpl   $0x0,-0xa4(%rbp)
  jne    L242
  mov    -0xb0(%rbp),%rax
  mov    %rax,%rsi
  lea    D215(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x84(%rbp),%eax
  mov    $0x1,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edx
  lea    D90(%rip),%rax
  mov    %rax,%rsi
  lea    D165(%rip),%rax
  mov    %rax,%rdi
  call   <print_number@plt>
  mov    -0x80(%rbp),%eax
  mov    $0x1,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edx
  lea    D90(%rip),%rax
  mov    %rax,%rsi
  lea    D116(%rip),%rax
  mov    %rax,%rdi
  call   <print_number@plt>
  mov    -0x7c(%rbp),%eax
  mov    $0x1,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edx
  lea    D90(%rip),%rax
  mov    %rax,%rsi
  lea    D173(%rip),%rax
  mov    %rax,%rdi
  call   <print_number@plt>
  mov    -0x78(%rbp),%eax
  mov    $0x1,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edx
  lea    D90(%rip),%rax
  mov    %rax,%rsi
  lea    D131(%rip),%rax
  mov    %rax,%rdi
  call   <print_number@plt>
  mov    -0x74(%rbp),%eax
  mov    $0x1,%r9d
  mov    $0x1,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edx
  lea    D90(%rip),%rax
  mov    %rax,%rsi
  lea    D188(%rip),%rax
  mov    %rax,%rdi
  call   <print_number@plt>
  mov    -0x70(%rbp),%eax
  mov    $0x1,%r9d
  mov    $0x1,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edx
  lea    D90(%rip),%rax
  mov    %rax,%rsi
  lea    D89(%rip),%rax
  mov    %rax,%rdi
  call   <print_number@plt>
  mov    -0x6c(%rbp),%eax
  mov    $0x1,%r9d
  mov    $0x1,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edx
  lea    D90(%rip),%rax
  mov    %rax,%rsi
  lea    D168(%rip),%rax
  mov    %rax,%rdi
  call   <print_number@plt>
  jmp    L97
L242:
  mov    -0xa4(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L182
  mov    -0x84(%rbp),%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
L182:
  mov    -0xa4(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L7
  mov    -0x80(%rbp),%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
L7:
  mov    -0xa4(%rbp),%eax
  and    $0x4,%eax
  test   %eax,%eax
  je     L206
  mov    -0x7c(%rbp),%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
L206:
  mov    -0xa4(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L84
  mov    -0x78(%rbp),%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
L84:
  mov    -0xa4(%rbp),%eax
  and    $0x10,%eax
  test   %eax,%eax
  je     L96
  mov    -0x74(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
L96:
  mov    -0xa4(%rbp),%eax
  and    $0x20,%eax
  test   %eax,%eax
  je     L59
  mov    -0x70(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
L59:
  mov    -0xa4(%rbp),%eax
  and    $0x40,%eax
  test   %eax,%eax
  je     L289
  mov    -0x6c(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
L289:
  mov    -0xb0(%rbp),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L97:
  mov    $0x0,%eax
L281:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L193
  call   <__stack_chk_fail@plt>
L193:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D53
datatype: string
name: retrieve_data
arguments: label: D99
datatype: string
name: retrieve_data
arguments: label: D104
datatype: string
name: retrieve_data
arguments: label: D194
datatype: string
name: retrieve_data
arguments: label: D20
datatype: string
name: retrieve_data
arguments: label: D187
datatype: string
name: retrieve_data
arguments: label: D215
datatype: string
name: retrieve_data
arguments: label: D90
datatype: string
name: retrieve_data
arguments: label: D165
datatype: string
name: retrieve_data
arguments: label: D116
datatype: string
name: retrieve_data
arguments: label: D173
datatype: string
name: retrieve_data
arguments: label: D131
datatype: string
name: retrieve_data
arguments: label: D188
datatype: string
name: retrieve_data
arguments: label: D89
datatype: string
name: retrieve_data
arguments: label: D168
datatype: string

tool: D53: %s: master query: send error


tool: D99: %s: master query: receive error


tool: D104: %s: master query: wrong answer (type)


tool: D194: %s: master query: wrong answer (queryid)


tool: D20: %s: %s


tool: D187: %s: master query: wrong answer (leng)


tool: D215: %s:


tool: D90: 


tool: D165:  inodes:       

tool: D116:   directories: 

tool: D173:   files:       

tool: D131:  chunks:       

tool: D188:  length:       

tool: D89:  size:         

tool: D168:  realsize:     

assistant: ```c
int dir_info(uint8_t dirinfomode, const char *fname) {
  uint8_t reqbuff[16], *wptr, *buff;
  const uint8_t *rptr;
  uint32_t cmd, leng, inode;
  uint32_t inodes, dirs, files, chunks;
  uint64_t length, size, realsize;
  int fd;
  fd = open_master_conn(fname, &inode, NULL, NULL, 0, 0);
  if (fd < 0) {
    return -1;
  }
  wptr = reqbuff;
  put32bit(&wptr, (0 + 462));
  put32bit(&wptr, 8);
  put32bit(&wptr, 0);
  put32bit(&wptr, inode);
  if (tcptowrite(fd, reqbuff, 16, 10000) != 16) {
    printf("%s: master query: send error\n", fname);
    close_master_conn(1);
    return -1;
  }
  if (tcptoread(fd, reqbuff, 8, 10000) != 8) {
    printf("%s: master query: receive error\n", fname);
    close_master_conn(1);
    return -1;
  }
  rptr = reqbuff;
  cmd = get32bit(&rptr);
  leng = get32bit(&rptr);
  if (cmd != (0 + 463)) {
    printf("%s: master query: wrong answer (type)\n", fname);
    close_master_conn(1);
    return -1;
  }
  buff = malloc(leng);
  if (tcptoread(fd, buff, leng, 10000) != (int32_t)leng) {
    printf("%s: master query: receive error\n", fname);
    free(buff);
    close_master_conn(1);
    return -1;
  }
  rptr = buff;
  cmd = get32bit(&rptr);
  if (cmd != 0) {
    printf("%s: master query: wrong answer (queryid)\n", fname);
    free(buff);
    close_master_conn(1);
    return -1;
  }
  leng -= 4;
  if (leng == 1) {
    printf("%s: %s\n", fname, mfsstrerr(*rptr));
    free(buff);
    close_master_conn(1);
    return -1;
  } else if (leng != 56 && leng != 40) {
    printf("%s: master query: wrong answer (leng)\n", fname);
    free(buff);
    close_master_conn(1);
    return -1;
  }
  close_master_conn(0);
  inodes = get32bit(&rptr);
  dirs = get32bit(&rptr);
  files = get32bit(&rptr);
  if (leng == 56) {
    rptr += 8;
  }
  chunks = get32bit(&rptr);
  if (leng == 56) {
    rptr += 8;
  }
  length = get64bit(&rptr);
  size = get64bit(&rptr);
  realsize = get64bit(&rptr);
  free(buff);
  if (dirinfomode == 0) {
    printf("%s:\n", fname);
    print_number(" inodes:       ", "\n", inodes, 0, 0, 1);
    print_number("  directories: ", "\n", dirs, 0, 0, 1);
    print_number("  files:       ", "\n", files, 0, 0, 1);
    print_number(" chunks:       ", "\n", chunks, 0, 0, 1);
    print_number(" length:       ", "\n", length, 0, 1, 1);
    print_number(" size:         ", "\n", size, 0, 1, 1);
    print_number(" realsize:     ", "\n", realsize, 0, 1, 1);
  } else {
    if (dirinfomode & 0x01) {
      print_number_only(inodes, 0);
      printf("\t");
    }
    if (dirinfomode & 0x02) {
      print_number_only(dirs, 0);
      printf("\t");
    }
    if (dirinfomode & 0x04) {
      print_number_only(files, 0);
      printf("\t");
    }
    if (dirinfomode & 0x08) {
      print_number_only(chunks, 0);
      printf("\t");
    }
    if (dirinfomode & 0x10) {
      print_number_only(length, 1);
      printf("\t");
    }
    if (dirinfomode & 0x20) {
      print_number_only(size, 1);
      printf("\t");
    }
    if (dirinfomode & 0x40) {
      print_number_only(realsize, 1);
      printf("\t");
    }
    printf("%s\n", fname);
  }
  return 0;
}
```