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

```asm
<PS2_FormatMemoryUnit>:
  endbr64
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x70,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  cmp    $0x3ff,%edi
  ja     L64
  pxor   %xmm0,%xmm0
  test   %esi,%esi
  lea    D105(%rip),%rbx
  cvtsi2ss %edi,%xmm0
  lea    D114(%rip),%rax
  cmove  %rax,%rbx
L184:
  movslq D89(%rip),%r12
  lea    D99(%rip),%rdx
  mov    %rsp,%r13
  mov    $0x64,%esi
  mov    %r13,%rdi
  cvtss2sd %xmm0,%xmm0
  mov    %r12,%rax
  shl    $0x7,%r12
  add    $0x1,%eax
  add    %rdx,%r12
  lea    D63(%rip),%rdx
  and    $0x7,%eax
  mov    %eax,D78(%rip)
  mov    $0x1,%eax
  call   <snprintf@plt>
  test   %eax,%eax
  jle    L176
  movzbl (%rsp),%edx
  mov    %r13,%rax
  test   %dl,%dl
  jne    L38
  jmp    L132
  xchg   %ax,%ax
L180:
  test   %dl,%dl
  je     L132
L38:
  mov    %edx,%esi
  mov    %rax,%rcx
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  cmp    $0x2e,%sil
  jne    L180
  nopw   0x0(%rax,%rax,1)
L8:
  mov    %rcx,%rax
  lea    0x1(%rcx),%rcx
  cmpb   $0x0,0x1(%rax)
  jne    L8
  movzbl -0x1(%rcx),%edx
  cmp    $0x30,%dl
  jne    L111
  cs nopw 0x0(%rax,%rax,1)
L19:
  movb   $0x0,(%rax)
  movzbl -0x1(%rax),%edx
  sub    $0x1,%rax
  cmp    $0x30,%dl
  je     L19
L111:
  cmp    $0x2e,%dl
  je     L75
L132:
  xor    %eax,%eax
  mov    %rbx,%r8
  mov    %r13,%rcx
  mov    $0x80,%esi
  lea    D78(%rip),%rdx
  mov    %r12,%rdi
  call   <snprintf@plt>
  test   %eax,%eax
  jle    L176
L78:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L121
  add    $0x70,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  pop    %r13
  ret
  xchg   %ax,%ax
L64:
  cmp    $0xfffff,%edi
  ja     L140
  test   %esi,%esi
  lea    D100(%rip),%rbx
  lea    D1(%rip),%rax
  pxor   %xmm0,%xmm0
  cmove  %rax,%rbx
  cvtsi2ss %edi,%xmm0
  mulss  D91(%rip),%xmm0
  jmp    L184
  nopl   0x0(%rax)
L140:
  cmp    $0x3fffffff,%edi
  ja     L79
  pxor   %xmm0,%xmm0
  test   %esi,%esi
  movss  D91(%rip),%xmm1
  lea    D123(%rip),%rbx
  cvtsi2ss %edi,%xmm0
  lea    D141(%rip),%rax
  cmove  %rax,%rbx
  mulss  %xmm1,%xmm0
  mulss  %xmm1,%xmm0
  jmp    L184
  nopl   0x0(%rax)
L176:
  movl   $0x3f3f3f,(%r12)
  jmp    L78
  nopl   (%rax)
L79:
  mov    %edi,%edi
  pxor   %xmm0,%xmm0
  movss  D91(%rip),%xmm1
  test   %esi,%esi
  cvtsi2ss %rdi,%xmm0
  lea    D126(%rip),%rbx
  lea    D75(%rip),%rax
  cmove  %rax,%rbx
  mulss  %xmm1,%xmm0
  mulss  %xmm1,%xmm0
  mulss  %xmm1,%xmm0
  jmp    L184
L75:
  movb   $0x0,(%rax)
  jmp    L132
L121:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D105
type: string
name: unpack_data
arguments: label: D114
type: string
name: unpack_data
arguments: label: D63
type: string
name: unpack_data
arguments: label: D78
type: string
name: unpack_data
arguments: label: D100
type: string
name: unpack_data
arguments: label: D1
type: string
name: unpack_data
arguments: label: D91
type: byte[4]
name: unpack_data
arguments: label: D123
type: string
name: unpack_data
arguments: label: D141
type: string
name: unpack_data
arguments: label: D126
type: string
name: unpack_data
arguments: label: D75
type: string

tool: D105: B

tool: D114: Bytes

tool: D63: %.2f

tool: D78: %s %s

tool: D100: KB

tool: D1: Kilobytes

tool: {"D91": [0x00,0x00,0x80,0x3a]}

tool: D123: MB

tool: D141: Megabytes

tool: D126: GB

tool: D75: Gigabytes

assistant: ```c
const char *PS2_FormatMemoryUnit(unsigned int size_bytes, int abbreviated) {
  enum { KILOBYTE = 1024, MEGABYTE = 1024 * KILOBYTE, GIGABYTE = 1024 * MEGABYTE };
  const char *mem_unit_str;
  float adjusted_size;
  if (size_bytes < KILOBYTE) {
    mem_unit_str = abbreviated ? "B" : "Bytes";
    adjusted_size = (float)size_bytes;
  } else if (size_bytes < MEGABYTE) {
    mem_unit_str = abbreviated ? "KB" : "Kilobytes";
    adjusted_size = size_bytes / 1024.0f;
  } else if (size_bytes < GIGABYTE) {
    mem_unit_str = abbreviated ? "MB" : "Megabytes";
    adjusted_size = size_bytes / 1024.0f / 1024.0f;
  } else {
    mem_unit_str = abbreviated ? "GB" : "Gigabytes";
    adjusted_size = size_bytes / 1024.0f / 1024.0f / 1024.0f;
  }
  char *fmtbuf;
  int chars_written;
  char num_str_buf[100];
  enum { MEM_UNIT_STR_MAXLEN = sizeof(num_str_buf) + 28 };
  static int bufnum = 0;
  static char local_str_buf[8][MEM_UNIT_STR_MAXLEN];
  fmtbuf = local_str_buf[bufnum];
  bufnum = (bufnum + 1) & 7;
  chars_written = snprintf(num_str_buf, 100, "%.2f", adjusted_size);
  if (chars_written <= 0) {
    fmtbuf[0] = '?';
    fmtbuf[1] = '?';
    fmtbuf[2] = '?';
    fmtbuf[3] = '\0';
    return fmtbuf;
  }
  char *p = num_str_buf;
  for (; *p; ++p) {
    if (*p == '.') {
      while (*++p) {
      }
      while (*--p == '0') {
        *p = '\0';
      }
      if (*p == '.') {
        *p = '\0';
      }
      break;
    }
  }
  chars_written = snprintf(fmtbuf, MEM_UNIT_STR_MAXLEN, "%s %s", num_str_buf, mem_unit_str);
  if (chars_written <= 0) {
    fmtbuf[0] = '?';
    fmtbuf[1] = '?';
    fmtbuf[2] = '?';
    fmtbuf[3] = '\0';
    return fmtbuf;
  }
  return fmtbuf;
}
```