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

```asm
<szwrite>:
  endbr64
  push   %r13
  mov    %rcx,%r13
  push   %r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  movabs $0x5a455054474d4b00,%rax
  movb   $0x59,0x17(%rsp)
  mov    %rax,0xf(%rsp)
  test   %rdx,%rdx
  jne    L5
  test   %rcx,%rcx
  je     L86
  mov    %rcx,%rbp
L4:
  cmp    $0x270f,%rsi
  jbe    L31
L70:
  xor    %eax,%eax
  nopl   (%rax)
L138:
  add    $0x1,%rax
  shr    $0xa,%rsi
  cmp    $0x8,%rax
  ja     L111
  cmp    $0x270f,%rsi
  ja     L138
L111:
  movzbl 0xf(%rsp,%rax,1),%eax
  mov    %al,0xd(%rsp)
  cmp    $0x270f,%rsi
  jbe    L151
  movb   $0x39,0xc(%rsp)
  mov    $0x5,%r12d
  lea    0x9(%rsp),%rsi
  movl   $0x3939393e,0x8(%rsp)
L1:
  mov    %r12,%rdx
  mov    %rbx,%rdi
  call   <memcpy@plt>
  cmpb   $0x0,0xd(%rsp)
  cmovne %r13,%rbp
  test   %rbp,%rbp
  je     L92
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    (%rbx,%r12,1),%rdi
  mov    %rbp,%rsi
  mov    %rax,%r13
  mov    %rax,%rdx
  call   <memcpy@plt>
  add    %r13,%r12
L92:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L184
  add    $0x28,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L86:
  test   %rdx,%rdx
  je     L4
L5:
  test   %r13,%r13
  cmove  %rbp,%r13
  cmp    $0x270f,%rsi
  ja     L70
L31:
  movb   $0x0,0xd(%rsp)
  test   %rsi,%rsi
  jne    L151
  movb   $0x30,0x8(%rsp)
  mov    $0x6,%r12d
  lea    0x8(%rsp),%rsi
  jmp    L1
  nopl   0x0(%rax)
L151:
  movabs $0xcccccccccccccccd,%rdi
  mov    %rsi,%rax
  mul    %rdi
  mov    %rsi,%rax
  mov    %rdx,%rcx
  shr    $0x3,%rcx
  lea    (%rcx,%rcx,4),%rdx
  add    %rdx,%rdx
  sub    %rdx,%rax
  add    $0x30,%eax
  mov    %al,0xc(%rsp)
  cmp    $0x9,%rsi
  jbe    L88
  mov    %rcx,%rax
  mul    %rdi
  shr    $0x3,%rdx
  lea    (%rdx,%rdx,4),%rax
  mov    %rdx,%r8
  add    %rax,%rax
  sub    %rax,%rcx
  add    $0x30,%ecx
  mov    %cl,0xb(%rsp)
  cmp    $0x63,%rsi
  jbe    L75
  mov    %rdx,%rax
  mul    %rdi
  shr    $0x3,%rdx
  lea    (%rdx,%rdx,4),%rax
  add    %rax,%rax
  sub    %rax,%r8
  add    $0x30,%r8d
  mov    %r8b,0xa(%rsp)
  cmp    $0x3e7,%rsi
  jbe    L41
  add    $0x30,%edx
  mov    $0x1,%eax
  mov    %dl,0x9(%rsp)
L56:
  mov    $0x6,%r12d
  lea    0x8(%rsp,%rax,1),%rsi
  sub    %rax,%r12
  jmp    L1
L75:
  mov    $0x3,%eax
  jmp    L56
L88:
  mov    $0x4,%eax
  jmp    L56
L41:
  mov    $0x2,%eax
  jmp    L56
L184:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
size_t szwrite(char *out, size_t s, const char *suf, const char *sufs) {
  const char suffix[] = {0, 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'};
  char b[6];
  size_t i;
  if (suf == NULL && sufs != NULL)
    suf = sufs;
  else if (suf != NULL && sufs == NULL)
    sufs = suf;
  for (i = 0; i < sizeof(suffix) && s > 9999; i++, s /= 1024)
    ;
  b[5] = suffix[i];
  if (s > 9999) {
    b[0] = '>';
    b[1] = b[2] = b[3] = b[4] = '9';
    i = 0;
  } else if (s == 0)
    b[i--] = '0';
  else
    for (i = 4; i > 0 && s > 0; i--, s /= 10)
      b[i] = s % 10 + '0';
  i++;
  s = sizeof(b) - i;
  (void)memcpy(out, b + i, s);
  if (b[5])
    suf = sufs;
  if (suf != NULL) {
    i = strlen(suf);
    (void)memcpy(out + s, suf, i);
    s += i;
  }
  return (s);
}
```