user: Converte this assembly snippet into its equivalent C code:

```asm
<print_cmdr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x58(%rbp),%rax
  sub    $0xffffffffffffff80,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x58(%rbp),%rax
  add    $0x81,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  add    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    $0x82,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  add    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    $0x83,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  lea    (%rdx,%rax,1),%r13d
  mov    -0x58(%rbp),%rax
  add    $0x6,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x58(%rbp),%rax
  add    $0x7,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  add    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    $0x8,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  add    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    $0x9,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  lea    (%rdx,%rax,1),%r12d
  mov    -0x58(%rbp),%rax
  add    $0x1e,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x58(%rbp),%rax
  add    $0x1f,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  add    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    $0x20,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  add    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    $0x21,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  lea    (%rdx,%rax,1),%ebx
  mov    -0x58(%rbp),%rax
  add    $0x99,%rax
  movzbl (%rax),%eax
  movzbl %al,%r10d
  mov    -0x58(%rbp),%rax
  add    $0xa8,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x58(%rbp),%rax
  add    $0xa9,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  add    %edx,%eax
  mov    %eax,%eax
  test   %rax,%rax
  js     L8
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L1
L8:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L1:
  movsd  D2(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rsi
  mov    -0x58(%rbp),%rax
  add    $0xa6,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x58(%rbp),%rax
  add    $0xa7,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  add    %edx,%eax
  mov    %eax,%ecx
  mov    $0x88888889,%edx
  imul   %rcx,%rdx
  shr    $0x20,%rdx
  mov    %edx,%ecx
  shr    $0x5,%ecx
  imul   $0x3c,%ecx,%edx
  sub    %edx,%eax
  mov    %eax,%ecx
  mov    -0x58(%rbp),%rax
  add    $0xa6,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x58(%rbp),%rax
  add    $0xa7,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  add    %edx,%eax
  mov    %eax,%edx
  mov    $0x88888889,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  mov    %eax,%r11d
  shr    $0x5,%r11d
  mov    -0x58(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%r9d
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%r8d
  mov    -0x58(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%r15d
  mov    -0x58(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%r14d
  mov    -0x58(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x58(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  lea    0x7d0(%rax),%edi
  mov    -0x58(%rbp),%rax
  add    $0x46,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x5c(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x47,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  add    -0x5c(%rbp),%eax
  push   %r13
  push   %r12
  push   %rbx
  push   %r10
  push   %rcx
  push   %r11
  push   %r9
  push   %r8
  movq   %rsi,%xmm0
  mov    %r15d,%r9d
  mov    %r14d,%r8d
  mov    %edx,%ecx
  mov    %edi,%edx
  mov    %eax,%esi
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  add    $0x40,%rsp
  mov    -0x58(%rbp),%rax
  add    $0x6,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x58(%rbp),%rax
  add    $0x7,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  add    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    $0x8,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  add    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    $0x9,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  add    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    $0x1e,%rax
  movzbl (%rax),%eax
  movzbl %al,%ecx
  mov    -0x58(%rbp),%rax
  add    $0x1f,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  add    %eax,%ecx
  mov    -0x58(%rbp),%rax
  add    $0x20,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  add    %eax,%ecx
  mov    -0x58(%rbp),%rax
  add    $0x21,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  add    %eax,%ecx
  lea    -0x44(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <read_block@plt>
  mov    %rax,-0x40(%rbp)
  mov    -0x44(%rbp),%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <print_pre_dive@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x58(%rbp),%rax
  add    $0x100,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x58(%rbp),%rax
  add    $0x101,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  add    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    $0x102,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  add    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    $0x103,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  add    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    $0x6,%rax
  movzbl (%rax),%eax
  movzbl %al,%ecx
  mov    -0x58(%rbp),%rax
  add    $0x7,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  add    %eax,%ecx
  mov    -0x58(%rbp),%rax
  add    $0x8,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  add    %eax,%ecx
  mov    -0x58(%rbp),%rax
  add    $0x9,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  add    %eax,%ecx
  lea    -0x44(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <read_block@plt>
  mov    %rax,-0x40(%rbp)
  mov    -0x44(%rbp),%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <print_emc_profile@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L14
  call   <__stack_chk_fail@plt>
L14:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D28
data_type: string
name: retrieve_data
arguments: data_tag: D2
data_type: f64
name: retrieve_data
arguments: data_tag: D14
data_type: string

tool: D28: Dive Date       Time     BT    Depth Temp Pre Ptr  Pro Ptr  End Ptr

tool: D2: 4

tool: D14: %4d %04d-%02d-%02d %02d:%02d:%02d %2d:%02d %5.1f %3dF %08x %08x %08x


assistant: ```c
void print_cmdr(const unsigned char *p) {
  printf("Dive Date       Time     BT    Depth Temp Pre Ptr  Pro Ptr  End Ptr\n");
  printf("%4d %04d-%02d-%02d %02d:%02d:%02d %2d:%02d %5.1f %3dF %08x %08x %08x\n", ((unsigned int)(p + 70)[0] + ((p + 70)[1] << 8)), *(p + 4) + 2000, *(p + 5), *(p + 2), *(p + 3), *p, *(p + 1), ((unsigned int)(p + 128 + 38)[0] + ((p + 128 + 38)[1] << 8)) / 60, ((unsigned int)(p + 128 + 38)[0] + ((p + 128 + 38)[1] << 8)) % 60, ((unsigned int)(p + 128 + 40)[0] + ((p + 128 + 40)[1] << 8)) / 4.0, *(p + 128 + 25), ((unsigned int)(p + 30)[0] + ((p + 30)[1] << 8) + ((p + 30)[2] << 16) + ((p + 30)[3] << 24)), ((unsigned int)(p + 6)[0] + ((p + 6)[1] << 8) + ((p + 6)[2] << 16) + ((p + 6)[3] << 24)), ((unsigned int)(p + 128)[0] + ((p + 128)[1] << 8) + ((p + 128)[2] << 16) + ((p + 128)[3] << 24)));
  unsigned char *profile;
  int size;
  profile = read_block(&size, ((unsigned int)(p + 30)[0] + ((p + 30)[1] << 8) + ((p + 30)[2] << 16) + ((p + 30)[3] << 24)), ((unsigned int)(p + 6)[0] + ((p + 6)[1] << 8) + ((p + 6)[2] << 16) + ((p + 6)[3] << 24)));
  print_pre_dive(profile, size);
  free(profile);
  profile = read_block(&size, ((unsigned int)(p + 6)[0] + ((p + 6)[1] << 8) + ((p + 6)[2] << 16) + ((p + 6)[3] << 24)), ((unsigned int)(p + 256)[0] + ((p + 256)[1] << 8) + ((p + 256)[2] << 16) + ((p + 256)[3] << 24)));
  print_emc_profile(profile, size);
  free(profile);
}
```