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

```asm
<dir_info>:
  endbr64
  push   %r15
  xor    %r9d,%r9d
  xor    %r8d,%r8d
  xor    %ecx,%ecx
  push   %r14
  mov    %rsi,%r14
  xor    %edx,%edx
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  mov    %r14,%rdi
  sub    $0x98,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  lea    0x2c(%rsp),%rsi
  call   <open_master_conn@plt>
  test   %eax,%eax
  js     L215
  lea    0x30(%rsp),%rbp
  lea    0x40(%rsp),%r12
  mov    $0x1ce,%esi
  mov    %eax,%r13d
  mov    %rbp,%rdi
  mov    %r12,0x30(%rsp)
  call   <put32bit@plt>
  mov    $0x8,%esi
  mov    %rbp,%rdi
  call   <put32bit@plt>
  xor    %esi,%esi
  mov    %rbp,%rdi
  call   <put32bit@plt>
  mov    0x2c(%rsp),%esi
  mov    %rbp,%rdi
  call   <put32bit@plt>
  mov    $0x2710,%ecx
  mov    %r12,%rsi
  mov    %r13d,%edi
  mov    $0x10,%edx
  call   <tcptowrite@plt>
  cmp    $0x10,%eax
  jne    L287
  mov    $0x2710,%ecx
  mov    $0x8,%edx
  mov    %r12,%rsi
  mov    %r13d,%edi
  call   <tcptoread@plt>
  cmp    $0x8,%eax
  jne    L103
  lea    0x38(%rsp),%rbp
  mov    %r12,0x38(%rsp)
  mov    %rbp,%rdi
  call   <get32bit@plt>
  mov    %rbp,%rdi
  mov    %eax,%r12d
  call   <get32bit@plt>
  mov    %eax,%r15d
  cmp    $0x1cf,%r12d
  jne    L331
  mov    %eax,%edi
  call   <malloc@plt>
  mov    $0x2710,%ecx
  mov    %r15d,%edx
  mov    %r13d,%edi
  mov    %rax,%rsi
  mov    %rax,%r12
  call   <tcptoread@plt>
  cmp    %r15d,%eax
  jne    L96
  mov    %rbp,%rdi
  mov    %eax,0xc(%rsp)
  mov    %r12,0x38(%rsp)
  call   <get32bit@plt>
  mov    0xc(%rsp),%edx
  test   %eax,%eax
  mov    %eax,%r13d
  jne    L278
  lea    -0x4(%rdx),%r15d
  cmp    $0x5,%edx
  je     L332
  and    $0xffffffef,%edx
  cmp    $0x2c,%edx
  jne    L95
  xor    %edi,%edi
  call   <close_master_conn@plt>
  mov    %rbp,%rdi
  call   <get32bit@plt>
  mov    %rbp,%rdi
  mov    %eax,0xc(%rsp)
  call   <get32bit@plt>
  mov    %rbp,%rdi
  mov    %eax,0x10(%rsp)
  call   <get32bit@plt>
  mov    %eax,0x14(%rsp)
  cmp    $0x38,%r15d
  je     L272
  mov    %rbp,%rdi
  call   <get32bit@plt>
  mov    %eax,0x1c(%rsp)
L136:
  mov    %rbp,%rdi
  call   <get64bit@plt>
  mov    %rbp,%rdi
  mov    %eax,%r15d
  call   <get64bit@plt>
  mov    %rbp,%rdi
  mov    %eax,0x18(%rsp)
  call   <get64bit@plt>
  mov    %r12,%rdi
  mov    %eax,%ebp
  call   <free@plt>
  test   %ebx,%ebx
  je     L170
  test   $0x1,%bl
  jne    L150
  test   $0x2,%bl
  jne    L248
L302:
  test   $0x4,%bl
  jne    L35
L173:
  test   $0x8,%bl
  jne    L151
L193:
  test   $0x10,%bl
  jne    L274
L37:
  test   $0x20,%bl
  jne    L267
L319:
  and    $0x40,%ebx
  jne    L260
L5:
  mov    %r14,%rdi
  call   <puts@plt>
L81:
  mov    0x88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L112
  add    $0x98,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L272:
  mov    %rbp,%rdi
  addq   $0x20,0x38(%rsp)
  call   <get32bit@plt>
  addq   $0x20,0x38(%rsp)
  mov    %eax,0x1c(%rsp)
  jmp    L136
  nopl   (%rax)
L170:
  mov    %r14,%rsi
  lea    D61(%rip),%rdi
  xor    %eax,%eax
  xor    %r13d,%r13d
  call   <printf@plt>
  mov    0xc(%rsp),%edx
  xor    %r8d,%r8d
  xor    %ecx,%ecx
  lea    D31(%rip),%r12
  mov    $0x1,%r9d
  lea    D104(%rip),%rdi
  mov    %r12,%rsi
  call   <print_number@plt>
  mov    0x10(%rsp),%edx
  xor    %r8d,%r8d
  xor    %ecx,%ecx
  mov    $0x1,%r9d
  mov    %r12,%rsi
  lea    D117(%rip),%rdi
  call   <print_number@plt>
  mov    0x14(%rsp),%edx
  xor    %r8d,%r8d
  xor    %ecx,%ecx
  mov    $0x1,%r9d
  mov    %r12,%rsi
  lea    D82(%rip),%rdi
  call   <print_number@plt>
  mov    0x1c(%rsp),%edx
  xor    %r8d,%r8d
  xor    %ecx,%ecx
  mov    $0x1,%r9d
  mov    %r12,%rsi
  lea    D49(%rip),%rdi
  call   <print_number@plt>
  mov    $0x1,%r9d
  xor    %ecx,%ecx
  mov    %r15d,%edx
  mov    $0x1,%r8d
  mov    %r12,%rsi
  lea    D112(%rip),%rdi
  call   <print_number@plt>
  mov    0x18(%rsp),%edx
  xor    %ecx,%ecx
  mov    %r12,%rsi
  mov    $0x1,%r9d
  mov    $0x1,%r8d
  lea    D71(%rip),%rdi
  call   <print_number@plt>
  mov    $0x1,%r9d
  xor    %ecx,%ecx
  mov    %ebp,%edx
  mov    $0x1,%r8d
  mov    %r12,%rsi
  lea    D85(%rip),%rdi
  call   <print_number@plt>
  jmp    L81
  nopl   0x0(%rax,%rax,1)
L260:
  mov    %ebp,%edi
  mov    $0x1,%esi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
  jmp    L5
  nopl   0x0(%rax,%rax,1)
L150:
  mov    0xc(%rsp),%edi
  xor    %esi,%esi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
  test   $0x2,%bl
  je     L302
L248:
  mov    0x10(%rsp),%edi
  xor    %esi,%esi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
  test   $0x4,%bl
  je     L173
L35:
  mov    0x14(%rsp),%edi
  xor    %esi,%esi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
  test   $0x8,%bl
  je     L193
L151:
  mov    0x1c(%rsp),%edi
  xor    %esi,%esi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
  test   $0x10,%bl
  je     L37
L274:
  mov    %r15d,%edi
  mov    $0x1,%esi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
  test   $0x20,%bl
  je     L319
L267:
  mov    0x18(%rsp),%edi
  mov    $0x1,%esi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
  and    $0x40,%ebx
  je     L5
  jmp    L260
  xchg   %ax,%ax
L287:
  mov    %r14,%rsi
  lea    D131(%rip),%rdi
L55:
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <close_master_conn@plt>
L215:
  mov    $0xffffffff,%r13d
  jmp    L81
  cs nopw 0x0(%rax,%rax,1)
L103:
  mov    %r14,%rsi
  lea    D23(%rip),%rdi
  jmp    L55
  nopl   0x0(%rax)
L331:
  mov    %r14,%rsi
  lea    D27(%rip),%rdi
  jmp    L55
  nopl   0x0(%rax)
L96:
  mov    %r14,%rsi
  lea    D23(%rip),%rdi
L74:
  xor    %eax,%eax
  call   <printf@plt>
L228:
  mov    %r12,%rdi
  mov    $0xffffffff,%r13d
  call   <free@plt>
  mov    $0x1,%edi
  call   <close_master_conn@plt>
  jmp    L81
L95:
  mov    %r14,%rsi
  lea    D120(%rip),%rdi
  jmp    L74
L278:
  mov    %r14,%rsi
  lea    D59(%rip),%rdi
  jmp    L74
L332:
  mov    0x38(%rsp),%rax
  mov    (%rax),%edi
  call   <mfsstrerr@plt>
  mov    %r14,%rsi
  lea    D16(%rip),%rdi
  mov    %rax,%rdx
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L228
L112:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D61
data_type: string
name: disassemble_data
arguments: tag: D31
data_type: string
name: disassemble_data
arguments: tag: D104
data_type: string
name: disassemble_data
arguments: tag: D117
data_type: string
name: disassemble_data
arguments: tag: D82
data_type: string
name: disassemble_data
arguments: tag: D49
data_type: string
name: disassemble_data
arguments: tag: D112
data_type: string
name: disassemble_data
arguments: tag: D71
data_type: string
name: disassemble_data
arguments: tag: D85
data_type: string
name: disassemble_data
arguments: tag: D131
data_type: string
name: disassemble_data
arguments: tag: D23
data_type: string
name: disassemble_data
arguments: tag: D27
data_type: string
name: disassemble_data
arguments: tag: D120
data_type: string
name: disassemble_data
arguments: tag: D59
data_type: string
name: disassemble_data
arguments: tag: D16
data_type: string

tool: D61: %s:


tool: D31: 


tool: D104:  inodes:       

tool: D117:   directories: 

tool: D82:   files:       

tool: D49:  chunks:       

tool: D112:  length:       

tool: D71:  size:         

tool: D85:  realsize:     

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


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


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


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


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


tool: D16: %s: %s


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;
}
```