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

```asm
<filesize_str>:
  endbr64
  push   %r12
  push   %rbx
  mov    %rdi,%rbx
  mov    $0xc,%edi
  sub    $0x8,%rsp
  call   <xmalloc@plt>
  mov    %rax,%r12
  mov    %rbx,%rax
  shr    $0x28,%rax
  jne    L58
  pxor   %xmm0,%xmm0
  cvtsi2sd %rbx,%xmm0
  cmp    $0x3fffffff,%rbx
  ja     L0
  cmp    $0xfffff,%rbx
  ja     L22
  cmp    $0x3ff,%rbx
  jbe    L29
  mulsd  D20(%rip),%xmm0
  mov    %r12,%rdi
  mov    $0xc,%esi
  lea    D67(%rip),%rdx
  call   <snprintf@plt>
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L0:
  mulsd  D43(%rip),%xmm0
  mov    %r12,%rdi
  mov    $0xc,%esi
  lea    D63(%rip),%rdx
  call   <snprintf@plt>
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L58:
  test   %rbx,%rbx
  js     L35
  pxor   %xmm0,%xmm0
  cvtsi2sd %rbx,%xmm0
L14:
  mulsd  D50(%rip),%xmm0
  mov    %r12,%rdi
  mov    $0xc,%esi
  lea    D87(%rip),%rdx
  call   <snprintf@plt>
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  ret
  nopl   (%rax)
L29:
  mov    %r12,%rdi
  lea    D30(%rip),%rdx
  mov    $0xc,%esi
  call   <snprintf@plt>
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L35:
  mov    %rbx,%rax
  and    $0x1,%ebx
  pxor   %xmm0,%xmm0
  shr    %rax
  or     %rbx,%rax
  cvtsi2sd %rax,%xmm0
  addsd  %xmm0,%xmm0
  jmp    L14
  nopl   0x0(%rax,%rax,1)
L22:
  mulsd  D29(%rip),%xmm0
  mov    %r12,%rdi
  mov    $0xc,%esi
  lea    D47(%rip),%rdx
  call   <snprintf@plt>
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D20
type_infered: byte[8]
name: disassemble_data
arguments: data_label: D67
type_infered: string
name: disassemble_data
arguments: data_label: D43
type_infered: byte[8]
name: disassemble_data
arguments: data_label: D63
type_infered: string
name: disassemble_data
arguments: data_label: D50
type_infered: byte[8]
name: disassemble_data
arguments: data_label: D87
type_infered: string
name: disassemble_data
arguments: data_label: D30
type_infered: string
name: disassemble_data
arguments: data_label: D29
type_infered: byte[8]
name: disassemble_data
arguments: data_label: D47
type_infered: string

tool: {"D20": [0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x3f]}

tool: D67: %.2f KiB

tool: {"D43": [0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x3e]}

tool: D63: %.2f GiB

tool: {"D50": [0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x3d]}

tool: D87: %.2f TiB

tool: D30: %.1f   B

tool: {"D29": [0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x3e]}

tool: D47: %.2f MiB

assistant: ```c
char *filesize_str(unsigned long long log_size) {
  char *size = xmalloc(sizeof(char) * 12);
  if (log_size >= 1099511627776LL)
    snprintf(size, 12, "%.2f TiB", (double)(log_size) / 1099511627776LL);
  else if (log_size >= 1073741824)
    snprintf(size, 12, "%.2f GiB", (double)(log_size) / 1073741824);
  else if (log_size >= 1048576)
    snprintf(size, 12, "%.2f MiB", (double)(log_size) / 1048576);
  else if (log_size >= 1024)
    snprintf(size, 12, "%.2f KiB", (double)(log_size) / 1024);
  else
    snprintf(size, 12, "%.1f   B", (double)(log_size));
  return size;
}
```