user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<PS2_FormatMemoryUnit>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  cmp    $0x3ff,%edi
  ja     L26
  test   %esi,%esi
  lea    D124(%rip),%rbp
  lea    D133(%rip),%rax
  cmove  %rax,%rbp
  mov    %edi,%edi
  pxor   %xmm0,%xmm0
  cvtsi2ss %rdi,%xmm0
L74:
  mov    D7(%rip),%eax
  movslq %eax,%rbx
  shl    $0x7,%rbx
  lea    D66(%rip),%rdx
  add    %rdx,%rbx
  add    $0x1,%eax
  and    $0x7,%eax
  mov    %eax,D77(%rip)
  cvtss2sd %xmm0,%xmm0
  mov    %rsp,%rdi
  lea    D77(%rip),%rdx
  mov    $0x64,%esi
  mov    $0x1,%eax
  call   <snprintf@plt>
  test   %eax,%eax
  jle    L167
  movzbl (%rsp),%edx
  mov    %rsp,%rax
  test   %dl,%dl
  je     L160
L47:
  cmp    $0x2e,%dl
  je     L142
  add    $0x1,%rax
  movzbl (%rax),%edx
  test   %dl,%dl
  jne    L47
L160:
  mov    %rsp,%rcx
  mov    %rbp,%r8
  lea    D102(%rip),%rdx
  mov    $0x80,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  test   %eax,%eax
  jle    L147
L18:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L112
  mov    %rbx,%rax
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  ret
L26:
  cmp    $0xfffff,%edi
  ja     L103
  test   %esi,%esi
  lea    D34(%rip),%rbp
  lea    D107(%rip),%rax
  cmove  %rax,%rbp
  mov    %edi,%edi
  pxor   %xmm0,%xmm0
  cvtsi2ss %rdi,%xmm0
  mulss  D58(%rip),%xmm0
  jmp    L74
L103:
  cmp    $0x3fffffff,%edi
  ja     L130
  test   %esi,%esi
  lea    D9(%rip),%rbp
  lea    D115(%rip),%rax
  cmove  %rax,%rbp
  mov    %edi,%edi
  pxor   %xmm0,%xmm0
  cvtsi2ss %rdi,%xmm0
  movss  D58(%rip),%xmm1
  mulss  %xmm1,%xmm0
  mulss  %xmm1,%xmm0
  jmp    L74
L130:
  test   %esi,%esi
  lea    D97(%rip),%rbp
  lea    D74(%rip),%rax
  cmove  %rax,%rbp
  mov    %edi,%edi
  pxor   %xmm0,%xmm0
  cvtsi2ss %rdi,%xmm0
  movss  D58(%rip),%xmm1
  mulss  %xmm1,%xmm0
  mulss  %xmm1,%xmm0
  mulss  %xmm1,%xmm0
  jmp    L74
L167:
  movb   $0x3f,(%rbx)
  movb   $0x3f,0x1(%rbx)
  movb   $0x3f,0x2(%rbx)
  movb   $0x0,0x3(%rbx)
  jmp    L18
L142:
  mov    %rax,%rdx
  add    $0x1,%rax
  cmpb   $0x0,(%rax)
  jne    L142
  movzbl -0x1(%rax),%eax
  cmp    $0x30,%al
  jne    L41
L13:
  movb   $0x0,(%rdx)
  sub    $0x1,%rdx
  movzbl (%rdx),%eax
  cmp    $0x30,%al
  je     L13
L41:
  cmp    $0x2e,%al
  jne    L160
  movb   $0x0,(%rdx)
  jmp    L160
L147:
  movb   $0x3f,(%rbx)
  movb   $0x3f,0x1(%rbx)
  movb   $0x3f,0x2(%rbx)
  movb   $0x0,0x3(%rbx)
  jmp    L18
L112:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D124
type_guessed: string
name: disassemble_data
arguments: data_label: D133
type_guessed: string
name: disassemble_data
arguments: data_label: D77
type_guessed: string
name: disassemble_data
arguments: data_label: D102
type_guessed: string
name: disassemble_data
arguments: data_label: D34
type_guessed: string
name: disassemble_data
arguments: data_label: D107
type_guessed: string
name: disassemble_data
arguments: data_label: D58
type_guessed: byte[4]
name: disassemble_data
arguments: data_label: D9
type_guessed: string
name: disassemble_data
arguments: data_label: D115
type_guessed: string
name: disassemble_data
arguments: data_label: D97
type_guessed: string
name: disassemble_data
arguments: data_label: D74
type_guessed: string

tool: D124: B

tool: D133: Bytes

tool: D77: %.2f

tool: D102: %s %s

tool: D34: KB

tool: D107: Kilobytes

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

tool: D9: MB

tool: D115: Megabytes

tool: D97: GB

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