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

```asm
<filesize_str>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    $0xc,%edi
  call   <xmalloc@plt>
  mov    %rax,-0x8(%rbp)
  movabs $0xffffffffff,%rax
  cmp    %rax,-0x18(%rbp)
  jbe    L101
  mov    -0x18(%rbp),%rax
  test   %rax,%rax
  js     L81
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L171
L81:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L171:
  movsd  D15(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rdx
  mov    -0x8(%rbp),%rax
  movq   %rdx,%xmm0
  lea    D67(%rip),%rdx
  mov    $0xc,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  jmp    L2
L101:
  cmpq   $0x3fffffff,-0x18(%rbp)
  jbe    L122
  mov    -0x18(%rbp),%rax
  test   %rax,%rax
  js     L124
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L140
L124:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L140:
  movsd  D70(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rdx
  mov    -0x8(%rbp),%rax
  movq   %rdx,%xmm0
  lea    D79(%rip),%rdx
  mov    $0xc,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  jmp    L2
L122:
  cmpq   $0xfffff,-0x18(%rbp)
  jbe    L12
  mov    -0x18(%rbp),%rax
  test   %rax,%rax
  js     L149
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L172
L149:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L172:
  movsd  D37(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rdx
  mov    -0x8(%rbp),%rax
  movq   %rdx,%xmm0
  lea    D65(%rip),%rdx
  mov    $0xc,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  jmp    L2
L12:
  cmpq   $0x3ff,-0x18(%rbp)
  jbe    L14
  mov    -0x18(%rbp),%rax
  test   %rax,%rax
  js     L143
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L115
L143:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L115:
  movsd  D25(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rdx
  mov    -0x8(%rbp),%rax
  movq   %rdx,%xmm0
  lea    D30(%rip),%rdx
  mov    $0xc,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  jmp    L2
L14:
  mov    -0x18(%rbp),%rax
  test   %rax,%rax
  js     L39
  pxor   %xmm2,%xmm2
  cvtsi2sd %rax,%xmm2
  movq   %xmm2,%rax
  jmp    L135
L39:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
  movq   %xmm0,%rax
L135:
  mov    -0x8(%rbp),%rcx
  movq   %rax,%xmm0
  lea    D82(%rip),%rax
  mov    %rax,%rdx
  mov    $0xc,%esi
  mov    %rcx,%rdi
  call   <snprintf@plt>
L2:
  mov    -0x8(%rbp),%rax
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D15
data_type: byte[8]
name: extract_symbolic_data
arguments: data_tag: D67
data_type: string
name: extract_symbolic_data
arguments: data_tag: D70
data_type: byte[8]
name: extract_symbolic_data
arguments: data_tag: D79
data_type: string
name: extract_symbolic_data
arguments: data_tag: D37
data_type: byte[8]
name: extract_symbolic_data
arguments: data_tag: D65
data_type: string
name: extract_symbolic_data
arguments: data_tag: D25
data_type: byte[8]
name: extract_symbolic_data
arguments: data_tag: D30
data_type: string
name: extract_symbolic_data
arguments: data_tag: D82
data_type: string

tool: {"D15": [0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x42]}

tool: D67: %.2f TiB

tool: {"D70": [0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0x41]}

tool: D79: %.2f GiB

tool: {"D37": [0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x41]}

tool: D65: %.2f MiB

tool: {"D25": [0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x40]}

tool: D30: %.2f KiB

tool: D82: %.1f   B

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