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

```asm
<fmtint>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,%r14
  mov    %rsi,%rbx
  mov    %rdx,%r12
  mov    %r8d,0x4(%rsp)
  mov    %r9d,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  mov    0x98(%rsp),%r15d
  and    $0x20,%r15d
  testb  $0x80,0x98(%rsp)
  je     L332
  mov    %rcx,%r13
  movb   $0x0,0x3(%rsp)
L32:
  mov    0x98(%rsp),%eax
  and    $0x40,%eax
  mov    %eax,0xc(%rsp)
  lea    0x10(%rsp),%rsi
  mov    %eax,%r8d
  mov    0x4(%rsp),%ecx
  mov    $0x2b,%edx
  mov    %r13,%rdi
  call   <convert@plt>
  mov    %eax,%ebp
  testb  $0x8,0x98(%rsp)
  je     L419
  test   %r13,%r13
  jne    L343
L419:
  mov    0x90(%rsp),%r13d
  movb   $0x0,0x4(%rsp)
L425:
  test   %r15d,%r15d
  jne    L371
L158:
  mov    0x8(%rsp),%edx
  sub    %r15d,%edx
  cmp    %ebp,%r13d
  mov    %ebp,%eax
  cmovge %r13d,%eax
  sub    %eax,%edx
  cmpb   $0x1,0x3(%rsp)
  adc    $0xffffffff,%edx
  cmpb   $0x0,0x4(%rsp)
  setne  %al
  movzbl %al,%eax
  add    %eax,%eax
  sub    %eax,%edx
  sub    %ebp,%r13d
  mov    %r13d,%eax
  sub    %r15d,%eax
  mov    $0x0,%ecx
  cmovs  %ecx,%eax
  test   %edx,%edx
  mov    $0x0,%edi
  cmovns %edx,%edi
  mov    0x98(%rsp),%r13d
  and    $0x1,%r13d
  je     L460
  neg    %edi
  mov    %edi,%r13d
  jmp    L160
L332:
  mov    %rcx,%rax
  neg    %rax
  cmovs  %rcx,%rax
  mov    %rax,%r13
  movb   $0x2d,0x3(%rsp)
  test   %rcx,%rcx
  js     L32
  movb   $0x2b,0x3(%rsp)
  testb  $0x2,0x98(%rsp)
  jne    L32
  mov    0x98(%rsp),%eax
  shr    $0x2,%eax
  and    $0x1,%eax
  shl    $0x5,%eax
  mov    %al,0x3(%rsp)
  jmp    L32
L343:
  mov    0x4(%rsp),%eax
  cmp    $0x8,%eax
  je     L36
  cmp    $0x10,%eax
  je     L320
  mov    0x90(%rsp),%r13d
  movb   $0x0,0x4(%rsp)
  jmp    L425
L36:
  cmp    %ebp,0x90(%rsp)
  jg     L278
  lea    0x1(%rbp),%r13d
  movb   $0x0,0x4(%rsp)
  jmp    L425
L320:
  mov    0x90(%rsp),%r13d
  cmpl   $0x1,0xc(%rsp)
  sbb    %eax,%eax
  and    $0x20,%eax
  add    $0x58,%eax
  mov    %al,0x4(%rsp)
  jmp    L425
L278:
  mov    0x90(%rsp),%r13d
  movb   $0x0,0x4(%rsp)
  jmp    L425
L371:
  mov    %ebp,%edi
  call   <getnumsep@plt>
  mov    %eax,%r15d
  jmp    L158
L460:
  testb  $0x10,0x98(%rsp)
  je     L137
  cmpl   $0xffffffff,0x90(%rsp)
  je     L260
L137:
  test   %edx,%edx
  jle    L110
  mov    %edi,%edx
  jmp    L298
L260:
  add    %edi,%eax
  jmp    L160
L401:
  addq   $0x1,(%rbx)
  sub    $0x1,%edx
  test   %edx,%edx
  jle    L173
L298:
  mov    (%rbx),%rcx
  lea    0x1(%rcx),%rsi
  cmp    %r12,%rsi
  jae    L401
  movb   $0x20,(%r14,%rcx,1)
  jmp    L401
L173:
  test   %edi,%edi
  mov    $0x1,%edx
  cmovg  %edi,%edx
  sub    %edx,%edi
  mov    %edi,%r13d
L160:
  movzbl 0x3(%rsp),%edi
  test   %dil,%dil
  je     L108
  mov    (%rbx),%rdx
  lea    0x1(%rdx),%rcx
  cmp    %r12,%rcx
  jae    L236
  mov    %dil,(%r14,%rdx,1)
L236:
  addq   $0x1,(%rbx)
L108:
  cmpb   $0x0,0x4(%rsp)
  je     L283
  mov    (%rbx),%rdx
  lea    0x1(%rdx),%rcx
  cmp    %r12,%rcx
  jae    L379
  movb   $0x30,(%r14,%rdx,1)
L379:
  mov    (%rbx),%rdx
  lea    0x1(%rdx),%rcx
  mov    %rcx,(%rbx)
  lea    0x2(%rdx),%rcx
  cmp    %r12,%rcx
  jae    L15
  movzbl 0x4(%rsp),%edi
  mov    %dil,0x1(%r14,%rdx,1)
L15:
  addq   $0x1,(%rbx)
L283:
  test   %eax,%eax
  jg     L305
L436:
  test   %ebp,%ebp
  jle    L334
  sub    $0x1,%ebp
  movslq %ebp,%rbp
  jmp    L75
L110:
  mov    %edi,%r13d
  jmp    L160
L477:
  addq   $0x1,(%rbx)
  sub    $0x1,%eax
  je     L436
L305:
  mov    (%rbx),%rdx
  lea    0x1(%rdx),%rcx
  cmp    %r12,%rcx
  jae    L477
  movb   $0x30,(%r14,%rdx,1)
  jmp    L477
L93:
  test   %eax,%eax
  jle    L334
L306:
  sub    $0x1,%rbp
L75:
  mov    %ebp,%edx
  mov    (%rbx),%rax
  lea    0x1(%rax),%rcx
  cmp    %r12,%rcx
  jae    L187
  movzbl 0x10(%rsp,%rbp,1),%ecx
  mov    %cl,(%r14,%rax,1)
L187:
  addq   $0x1,(%rbx)
  mov    %ebp,%eax
  test   %r15d,%r15d
  jle    L93
  test   %ebp,%ebp
  jle    L93
  movslq %edx,%rax
  imul   $0x55555556,%rax,%rax
  shr    $0x20,%rax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  lea    (%rax,%rax,2),%eax
  cmp    %eax,%edx
  jne    L306
  mov    %r12,%rdx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <printsep@plt>
  jmp    L306
L334:
  test   %r13d,%r13d
  js     L87
L299:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L139
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L94:
  addq   $0x1,(%rbx)
  add    $0x1,%r13d
  je     L299
L87:
  mov    (%rbx),%rax
  lea    0x1(%rax),%rdx
  cmp    %r12,%rdx
  jae    L94
  movb   $0x20,(%r14,%rax,1)
  jmp    L94
L139:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void fmtint(char *str, size_t *len, size_t size, long int value, int base, int width, int precision, int flags) {
  unsigned long int uvalue;
  char iconvert[43];
  char sign = 0;
  char hexprefix = 0;
  int spadlen = 0;
  int zpadlen = 0;
  int pos;
  int separators = (flags & (1 << 5));
  int noprecision = (precision == -1);
  if (flags & (1 << 7))
    uvalue = value;
  else {
    uvalue = (value >= 0) ? value : -value;
    if (value < 0)
      sign = '-';
    else if (flags & (1 << 1))
      sign = '+';
    else if (flags & (1 << 2))
      sign = ' ';
  }
  pos = convert(uvalue, iconvert, sizeof(iconvert), base, flags & (1 << 6));
  if (flags & (1 << 3) && uvalue != 0) {
    switch (base) {
    case 8:
      if (precision <= pos)
        precision = pos + 1;
      break;
    case 16:
      hexprefix = (flags & (1 << 6)) ? 'X' : 'x';
      break;
    }
  }
  if (separators)
    separators = getnumsep(pos);
  zpadlen = precision - pos - separators;
  spadlen = width - separators - ((precision >= pos) ? precision : pos) - ((sign != 0) ? 1 : 0) - ((hexprefix != 0) ? 2 : 0);
  if (zpadlen < 0)
    zpadlen = 0;
  if (spadlen < 0)
    spadlen = 0;
  if (flags & (1 << 0))
    spadlen = -spadlen;
  else if (flags & (1 << 4) && noprecision) {
    zpadlen += spadlen;
    spadlen = 0;
  }
  while (spadlen > 0) {
    do {
      if (*len + 1 < size)
        str[*len] = ' ';
      (*len)++;
    } while (0);
    spadlen--;
  }
  if (sign != 0)
    do {
      if (*len + 1 < size)
        str[*len] = sign;
      (*len)++;
    } while (0);
  if (hexprefix != 0) {
    do {
      if (*len + 1 < size)
        str[*len] = '0';
      (*len)++;
    } while (0);
    do {
      if (*len + 1 < size)
        str[*len] = hexprefix;
      (*len)++;
    } while (0);
  }
  while (zpadlen > 0) {
    do {
      if (*len + 1 < size)
        str[*len] = '0';
      (*len)++;
    } while (0);
    zpadlen--;
  }
  while (pos > 0) {
    pos--;
    do {
      if (*len + 1 < size)
        str[*len] = iconvert[pos];
      (*len)++;
    } while (0);
    if (separators > 0 && pos > 0 && pos % 3 == 0)
      printsep(str, len, size);
  }
  while (spadlen < 0) {
    do {
      if (*len + 1 < size)
        str[*len] = ' ';
      (*len)++;
    } while (0);
    spadlen++;
  }
}
```