user: Please show me the C implementation that matches the assembly code listed below:

```asm
<number>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x100,%rsp
  mov    %rdi,-0xd8(%rbp)
  mov    %rsi,-0xe0(%rbp)
  mov    %rdx,-0xe8(%rbp)
  mov    %ecx,-0xec(%rbp)
  mov    %r8d,-0xf0(%rbp)
  mov    %r9d,-0xf4(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movabs $0x3736353433323130,%rax
  movabs $0x6665646362613938,%rdx
  mov    %rax,-0xb0(%rbp)
  mov    %rdx,-0xa8(%rbp)
  movabs $0x6e6d6c6b6a696867,%rax
  movabs $0x767574737271706f,%rdx
  mov    %rax,-0xa0(%rbp)
  mov    %rdx,-0x98(%rbp)
  movl   $0x7a797877,-0x90(%rbp)
  movb   $0x0,-0x8c(%rbp)
  movabs $0x3736353433323130,%rax
  movabs $0x4645444342413938,%rdx
  mov    %rax,-0x80(%rbp)
  mov    %rdx,-0x78(%rbp)
  movabs $0x4e4d4c4b4a494847,%rax
  movabs $0x565554535251504f,%rdx
  mov    %rax,-0x70(%rbp)
  mov    %rdx,-0x68(%rbp)
  movl   $0x5a595857,-0x60(%rbp)
  movb   $0x0,-0x5c(%rbp)
  mov    0x10(%rbp),%eax
  and    $0x40,%eax
  test   %eax,%eax
  je     L204
  lea    -0x80(%rbp),%rax
  jmp    L389
L204:
  lea    -0xb0(%rbp),%rax
L389:
  mov    %rax,-0xb8(%rbp)
  mov    0x10(%rbp),%eax
  and    $0x10,%eax
  test   %eax,%eax
  je     L454
  andl   $0xfffffffe,0x10(%rbp)
L454:
  cmpl   $0x1,-0xec(%rbp)
  jle    L370
  cmpl   $0x24,-0xec(%rbp)
  jle    L446
L370:
  mov    $0x0,%eax
  jmp    L350
L446:
  mov    0x10(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L359
  mov    $0x30,%eax
  jmp    L488
L359:
  mov    $0x20,%eax
L488:
  mov    %al,-0xc1(%rbp)
  movb   $0x0,-0xc2(%rbp)
  mov    0x10(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L42
  cmpq   $0x0,-0xe8(%rbp)
  jns    L107
  movb   $0x2d,-0xc2(%rbp)
  negq   -0xe8(%rbp)
  subl   $0x1,-0xf0(%rbp)
  jmp    L42
L107:
  mov    0x10(%rbp),%eax
  and    $0x4,%eax
  test   %eax,%eax
  je     L413
  movb   $0x2b,-0xc2(%rbp)
  subl   $0x1,-0xf0(%rbp)
  jmp    L42
L413:
  mov    0x10(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L42
  movb   $0x20,-0xc2(%rbp)
  subl   $0x1,-0xf0(%rbp)
L42:
  mov    0x10(%rbp),%eax
  and    $0x20,%eax
  test   %eax,%eax
  je     L169
  cmpl   $0x10,-0xec(%rbp)
  jne    L189
  subl   $0x2,-0xf0(%rbp)
  jmp    L169
L189:
  cmpl   $0x8,-0xec(%rbp)
  jne    L169
  subl   $0x1,-0xf0(%rbp)
L169:
  movl   $0x0,-0xc0(%rbp)
  cmpq   $0x0,-0xe8(%rbp)
  jne    L296
  mov    -0xc0(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0xc0(%rbp)
  cltq
  movb   $0x30,-0x50(%rbp,%rax,1)
  jmp    L220
L52:
  mov    -0xe8(%rbp),%rax
  mov    -0xec(%rbp),%edx
  mov    %edx,%ecx
  mov    $0x0,%edx
  div    %rcx
  mov    %rdx,%rax
  mov    %eax,-0xbc(%rbp)
  mov    -0xe8(%rbp),%rax
  mov    -0xec(%rbp),%edx
  mov    %edx,%esi
  mov    $0x0,%edx
  div    %rsi
  mov    %rax,-0xe8(%rbp)
  mov    -0xbc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0xb8(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0xc0(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0xc0(%rbp)
  movzbl (%rcx),%edx
  cltq
  mov    %dl,-0x50(%rbp,%rax,1)
L296:
  cmpq   $0x0,-0xe8(%rbp)
  jne    L52
L220:
  mov    -0xc0(%rbp),%eax
  cmp    -0xf4(%rbp),%eax
  jle    L451
  mov    -0xc0(%rbp),%eax
  mov    %eax,-0xf4(%rbp)
L451:
  mov    -0xf4(%rbp),%eax
  sub    %eax,-0xf0(%rbp)
  mov    0x10(%rbp),%eax
  and    $0x11,%eax
  test   %eax,%eax
  jne    L136
  jmp    L322
L317:
  mov    -0xd8(%rbp),%rax
  cmp    -0xe0(%rbp),%rax
  ja     L34
  mov    -0xd8(%rbp),%rax
  movb   $0x20,(%rax)
L34:
  addq   $0x1,-0xd8(%rbp)
L322:
  mov    -0xf0(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0xf0(%rbp)
  test   %eax,%eax
  jg     L317
L136:
  cmpb   $0x0,-0xc2(%rbp)
  je     L377
  mov    -0xd8(%rbp),%rax
  cmp    -0xe0(%rbp),%rax
  ja     L412
  mov    -0xd8(%rbp),%rax
  movzbl -0xc2(%rbp),%edx
  mov    %dl,(%rax)
L412:
  addq   $0x1,-0xd8(%rbp)
L377:
  mov    0x10(%rbp),%eax
  and    $0x20,%eax
  test   %eax,%eax
  je     L411
  cmpl   $0x8,-0xec(%rbp)
  jne    L468
  mov    -0xd8(%rbp),%rax
  cmp    -0xe0(%rbp),%rax
  ja     L487
  mov    -0xd8(%rbp),%rax
  movb   $0x30,(%rax)
L487:
  addq   $0x1,-0xd8(%rbp)
  jmp    L411
L468:
  cmpl   $0x10,-0xec(%rbp)
  jne    L411
  mov    -0xd8(%rbp),%rax
  cmp    -0xe0(%rbp),%rax
  ja     L68
  mov    -0xd8(%rbp),%rax
  movb   $0x30,(%rax)
L68:
  addq   $0x1,-0xd8(%rbp)
  mov    -0xd8(%rbp),%rax
  cmp    -0xe0(%rbp),%rax
  ja     L462
  mov    -0xb8(%rbp),%rax
  add    $0x21,%rax
  movzbl (%rax),%edx
  mov    -0xd8(%rbp),%rax
  mov    %dl,(%rax)
L462:
  addq   $0x1,-0xd8(%rbp)
L411:
  mov    0x10(%rbp),%eax
  and    $0x10,%eax
  test   %eax,%eax
  jne    L379
  jmp    L88
L141:
  mov    -0xd8(%rbp),%rax
  cmp    -0xe0(%rbp),%rax
  ja     L95
  mov    -0xd8(%rbp),%rax
  movzbl -0xc1(%rbp),%edx
  mov    %dl,(%rax)
L95:
  addq   $0x1,-0xd8(%rbp)
L88:
  mov    -0xf0(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0xf0(%rbp)
  test   %eax,%eax
  jg     L141
  jmp    L379
L236:
  mov    -0xd8(%rbp),%rax
  cmp    -0xe0(%rbp),%rax
  ja     L14
  mov    -0xd8(%rbp),%rax
  movb   $0x30,(%rax)
L14:
  addq   $0x1,-0xd8(%rbp)
L379:
  mov    -0xf4(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0xf4(%rbp)
  cmp    %eax,-0xc0(%rbp)
  jl     L236
  jmp    L241
L319:
  mov    -0xd8(%rbp),%rax
  cmp    -0xe0(%rbp),%rax
  ja     L294
  mov    -0xc0(%rbp),%eax
  cltq
  movzbl -0x50(%rbp,%rax,1),%edx
  mov    -0xd8(%rbp),%rax
  mov    %dl,(%rax)
L294:
  addq   $0x1,-0xd8(%rbp)
L241:
  mov    -0xc0(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0xc0(%rbp)
  test   %eax,%eax
  jg     L319
  jmp    L166
L174:
  mov    -0xd8(%rbp),%rax
  cmp    -0xe0(%rbp),%rax
  ja     L143
  mov    -0xd8(%rbp),%rax
  movb   $0x20,(%rax)
L143:
  addq   $0x1,-0xd8(%rbp)
L166:
  mov    -0xf0(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0xf0(%rbp)
  test   %eax,%eax
  jg     L174
  mov    -0xd8(%rbp),%rax
L350:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L279
  call   <__stack_chk_fail@plt>
L279:
  leave
  ret
```

assistant: ```c
char *number(char *buf, char *end, long long num, int base, int size, int precision, int type) {
  char c, sign, tmp[66];
  const char *digits;
  const char small_digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
  const char large_digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  int i;
  digits = (type & 64) ? large_digits : small_digits;
  if (type & 16)
    type &= ~1;
  if (base < 2 || base > 36)
    return 0;
  c = (type & 1) ? '0' : ' ';
  sign = 0;
  if (type & 2) {
    if (num < 0) {
      sign = '-';
      num = -num;
      size--;
    } else if (type & 4) {
      sign = '+';
      size--;
    } else if (type & 8) {
      sign = ' ';
      size--;
    }
  }
  if (type & 32) {
    if (base == 16)
      size -= 2;
    else if (base == 8)
      size--;
  }
  i = 0;
  if (num == 0)
    tmp[i++] = '0';
  else
    while (num != 0)
      tmp[i++] = digits[({
        int __res;
        __res = ((unsigned long)num) % (unsigned int)base;
        num = ((unsigned long)num) / (unsigned int)base;
        __res;
      })];
  if (i > precision)
    precision = i;
  size -= precision;
  if (!(type & (1 + 16))) {
    while (size-- > 0) {
      if (buf <= end)
        *buf = ' ';
      ++buf;
    }
  }
  if (sign) {
    if (buf <= end)
      *buf = sign;
    ++buf;
  }
  if (type & 32) {
    if (base == 8) {
      if (buf <= end)
        *buf = '0';
      ++buf;
    } else if (base == 16) {
      if (buf <= end)
        *buf = '0';
      ++buf;
      if (buf <= end)
        *buf = digits[33];
      ++buf;
    }
  }
  if (!(type & 16)) {
    while (size-- > 0) {
      if (buf <= end)
        *buf = c;
      ++buf;
    }
  }
  while (i < precision--) {
    if (buf <= end)
      *buf = '0';
    ++buf;
  }
  while (i-- > 0) {
    if (buf <= end)
      *buf = tmp[i];
    ++buf;
  }
  while (size-- > 0) {
    if (buf <= end)
      *buf = ' ';
    ++buf;
  }
  return buf;
}
```