user: Translate the below assembly code into C programming language:

```asm
<dir_info>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x98,%rsp
  mov    %edi,%ebx
  mov    %rsi,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  lea    0x2c(%rsp),%rsi
  mov    $0x0,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    %r13,%rdi
  call   <open_master_conn@plt>
  test   %eax,%eax
  js     L4
  mov    %eax,%r12d
  lea    0x40(%rsp),%r14
  mov    %r14,0x30(%rsp)
  lea    0x30(%rsp),%rbp
  mov    $0x1ce,%esi
  mov    %rbp,%rdi
  call   <put32bit@plt>
  mov    $0x8,%esi
  mov    %rbp,%rdi
  call   <put32bit@plt>
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <put32bit@plt>
  mov    0x2c(%rsp),%esi
  mov    %rbp,%rdi
  call   <put32bit@plt>
  mov    $0x2710,%ecx
  mov    $0x10,%edx
  mov    %r14,%rsi
  mov    %r12d,%edi
  call   <tcptowrite@plt>
  cmp    $0x10,%eax
  jne    L230
  lea    0x40(%rsp),%rsi
  mov    $0x2710,%ecx
  mov    $0x8,%edx
  mov    %r12d,%edi
  call   <tcptoread@plt>
  cmp    $0x8,%eax
  jne    L155
  lea    0x40(%rsp),%rax
  mov    %rax,0x38(%rsp)
  lea    0x38(%rsp),%r14
  mov    %r14,%rdi
  call   <get32bit@plt>
  mov    %eax,%ebp
  mov    %r14,%rdi
  call   <get32bit@plt>
  mov    %eax,%r15d
  cmp    $0x1cf,%ebp
  jne    L272
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  mov    $0x2710,%ecx
  mov    %r15d,%edx
  mov    %rax,%rsi
  mov    %r12d,%edi
  call   <tcptoread@plt>
  cmp    %r15d,%eax
  jne    L323
  mov    %rbp,0x38(%rsp)
  lea    0x38(%rsp),%rdi
  call   <get32bit@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jne    L102
  lea    -0x4(%r15),%r14d
  cmp    $0x5,%r15d
  je     L197
  and    $0xffffffef,%r15d
  cmp    $0x2c,%r15d
  jne    L74
  mov    $0x0,%edi
  call   <close_master_conn@plt>
  lea    0x38(%rsp),%r15
  mov    %r15,%rdi
  call   <get32bit@plt>
  mov    %eax,0xc(%rsp)
  mov    %r15,%rdi
  call   <get32bit@plt>
  mov    %eax,0x10(%rsp)
  mov    %r15,%rdi
  call   <get32bit@plt>
  mov    %eax,0x14(%rsp)
  cmp    $0x38,%r14d
  je     L123
  lea    0x38(%rsp),%rdi
  call   <get32bit@plt>
  mov    %eax,0x1c(%rsp)
L339:
  lea    0x38(%rsp),%r14
  mov    %r14,%rdi
  call   <get64bit@plt>
  mov    %eax,%r15d
  mov    %r14,%rdi
  call   <get64bit@plt>
  mov    %eax,0x18(%rsp)
  mov    %r14,%rdi
  call   <get64bit@plt>
  mov    %eax,%r14d
  mov    %rbp,%rdi
  call   <free@plt>
  test   %ebx,%ebx
  je     L28
  test   $0x1,%bl
  jne    L182
L218:
  test   $0x2,%bl
  jne    L139
L42:
  test   $0x4,%bl
  jne    L97
L290:
  test   $0x8,%bl
  jne    L303
L83:
  test   $0x10,%bl
  jne    L96
L35:
  test   $0x20,%bl
  jne    L85
L176:
  test   $0x40,%bl
  jne    L33
L257:
  mov    %r13,%rdi
  call   <puts@plt>
L132:
  mov    0x88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L301
  mov    %r12d,%eax
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L230:
  mov    %r13,%rsi
  lea    D154(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <close_master_conn@plt>
  mov    $0xffffffff,%r12d
  jmp    L132
L155:
  mov    %r13,%rsi
  lea    D61(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <close_master_conn@plt>
  mov    $0xffffffff,%r12d
  jmp    L132
L272:
  mov    %r13,%rsi
  lea    D5(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <close_master_conn@plt>
  mov    $0xffffffff,%r12d
  jmp    L132
L323:
  mov    %r13,%rsi
  lea    D61(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    $0x1,%edi
  call   <close_master_conn@plt>
  mov    $0xffffffff,%r12d
  jmp    L132
L102:
  mov    %r13,%rsi
  lea    D70(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    $0x1,%edi
  call   <close_master_conn@plt>
  mov    $0xffffffff,%r12d
  jmp    L132
L197:
  mov    0x38(%rsp),%rax
  mov    (%rax),%edi
  call   <mfsstrerr@plt>
  mov    %rax,%rdx
  mov    %r13,%rsi
  lea    D94(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    $0x1,%edi
  call   <close_master_conn@plt>
  mov    $0xffffffff,%r12d
  jmp    L132
L74:
  mov    %r13,%rsi
  lea    D66(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    $0x1,%edi
  call   <close_master_conn@plt>
  mov    $0xffffffff,%r12d
  jmp    L132
L123:
  addq   $0x20,0x38(%rsp)
  mov    %r15,%rdi
  call   <get32bit@plt>
  mov    %eax,0x1c(%rsp)
  addq   $0x20,0x38(%rsp)
  jmp    L339
L28:
  mov    %r13,%rsi
  lea    D117(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    0xc(%rsp),%edx
  lea    D126(%rip),%rbp
  mov    %rbp,%rsi
  lea    D124(%rip),%rdi
  call   <print_number@plt>
  mov    $0x1,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    0x10(%rsp),%edx
  mov    %rbp,%rsi
  lea    D13(%rip),%rdi
  call   <print_number@plt>
  mov    $0x1,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    0x14(%rsp),%edx
  mov    %rbp,%rsi
  lea    D4(%rip),%rdi
  call   <print_number@plt>
  mov    $0x1,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    0x1c(%rsp),%edx
  mov    %rbp,%rsi
  lea    D146(%rip),%rdi
  call   <print_number@plt>
  mov    $0x1,%r9d
  mov    $0x1,%r8d
  mov    $0x0,%ecx
  mov    %r15d,%edx
  mov    %rbp,%rsi
  lea    D75(%rip),%rdi
  call   <print_number@plt>
  mov    $0x1,%r9d
  mov    $0x1,%r8d
  mov    $0x0,%ecx
  mov    0x18(%rsp),%edx
  mov    %rbp,%rsi
  lea    D33(%rip),%rdi
  call   <print_number@plt>
  mov    $0x1,%r9d
  mov    $0x1,%r8d
  mov    $0x0,%ecx
  mov    %r14d,%edx
  mov    %rbp,%rsi
  lea    D49(%rip),%rdi
  call   <print_number@plt>
  mov    %ebx,%r12d
  jmp    L132
L182:
  mov    $0x0,%esi
  mov    0xc(%rsp),%edi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
  jmp    L218
L139:
  mov    $0x0,%esi
  mov    0x10(%rsp),%edi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
  jmp    L42
L97:
  mov    $0x0,%esi
  mov    0x14(%rsp),%edi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
  jmp    L290
L303:
  mov    $0x0,%esi
  mov    0x1c(%rsp),%edi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
  jmp    L83
L96:
  mov    $0x1,%esi
  mov    %r15d,%edi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
  jmp    L35
L85:
  mov    $0x1,%esi
  mov    0x18(%rsp),%edi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
  jmp    L176
L33:
  mov    $0x1,%esi
  mov    %r14d,%edi
  call   <print_number_only@plt>
  mov    $0x9,%edi
  call   <putchar@plt>
  jmp    L257
L4:
  mov    $0xffffffff,%r12d
  jmp    L132
L301:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D154
data_type: string
name: unpack_data
arguments: data_tag: D61
data_type: string
name: unpack_data
arguments: data_tag: D5
data_type: string
name: unpack_data
arguments: data_tag: D70
data_type: string
name: unpack_data
arguments: data_tag: D94
data_type: string
name: unpack_data
arguments: data_tag: D66
data_type: string
name: unpack_data
arguments: data_tag: D117
data_type: string
name: unpack_data
arguments: data_tag: D126
data_type: string
name: unpack_data
arguments: data_tag: D124
data_type: string
name: unpack_data
arguments: data_tag: D13
data_type: string
name: unpack_data
arguments: data_tag: D4
data_type: string
name: unpack_data
arguments: data_tag: D146
data_type: string
name: unpack_data
arguments: data_tag: D75
data_type: string
name: unpack_data
arguments: data_tag: D33
data_type: string
name: unpack_data
arguments: data_tag: D49
data_type: string

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


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


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


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


tool: D94: %s: %s


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


tool: D117: %s:


tool: D126: 


tool: D124:  inodes:       

tool: D13:   directories: 

tool: D4:   files:       

tool: D146:  chunks:       

tool: D75:  length:       

tool: D33:  size:         

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