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

```asm
<number>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x88,%rsp
  mov    %rsi,0x28(%rsp)
  mov    %ecx,0x10(%rsp)
  mov    %r8d,0x14(%rsp)
  mov    %r9d,%r12d
  mov    %fs:0x28,%rax
  mov    %rax,0x78(%rsp)
  xor    %eax,%eax
  test   $0x40,%r9b
  lea    D5(%rip),%r15
  lea    D3(%rip),%rax
  cmovne %rax,%r15
  mov    %r9d,%eax
  and    $0xfffffffe,%eax
  test   $0x10,%r9b
  cmovne %eax,%r12d
  mov    %edx,0xc(%rsp)
  lea    -0x2(%rdx),%eax
  cmp    $0x22,%eax
  ja     L304
  mov    %rdi,%rbx
  mov    %edx,%r14d
  mov    %r12d,%eax
  and    $0x1,%eax
  cmp    $0x1,%eax
  sbb    %r13d,%r13d
  and    $0xfffffff0,%r13d
  add    $0x30,%r13d
  test   $0x2,%r12b
  je     L281
  mov    %rsi,%rax
  test   %rsi,%rsi
  js     L72
  test   $0x4,%r12b
  je     L317
  subl   $0x1,0x10(%rsp)
  movb   $0x2b,0x1b(%rsp)
  jmp    L107
L72:
  neg    %rax
  mov    %rax,0x28(%rsp)
  sub    $0x1,%ecx
  mov    %ecx,0x10(%rsp)
  mov    %r12d,%esi
  and    $0x20,%esi
  mov    %esi,0x1c(%rsp)
  jne    L280
  movb   $0x2d,0x1b(%rsp)
L181:
  mov    $0x1,%ebp
  lea    0x28(%rsp),%rsi
  mov    %rsi,0x20(%rsp)
  jmp    L108
L317:
  movb   $0x0,0x1b(%rsp)
  test   $0x8,%r12b
  je     L107
  subl   $0x1,0x10(%rsp)
  movb   $0x20,0x1b(%rsp)
  jmp    L107
L281:
  movb   $0x0,0x1b(%rsp)
L107:
  mov    %r12d,%eax
  and    $0x20,%eax
  mov    %eax,0x1c(%rsp)
  je     L153
L192:
  cmp    $0x10,%r14d
  je     L198
  cmp    $0x8,%r14d
  sete   %al
  movzbl %al,%eax
  sub    %eax,0x10(%rsp)
L153:
  mov    0x28(%rsp),%rax
  test   %rax,%rax
  jne    L181
  movb   $0x30,0x30(%rsp)
  mov    $0x1,%esi
L322:
  mov    0x14(%rsp),%eax
  cmp    %eax,%esi
  mov    %eax,%edx
  cmovge %esi,%edx
  mov    0x10(%rsp),%r8d
  sub    %edx,%r8d
  test   $0x11,%r12b
  jne    L261
  lea    -0x1(%r8),%eax
  test   %r8d,%r8d
  jle    L81
  mov    %r8d,%ecx
  add    %rbx,%rcx
  mov    %rbx,%rax
L342:
  add    $0x1,%rax
  movb   $0x20,-0x1(%rax)
  cmp    %rcx,%rax
  jne    L342
  mov    %r8d,%r8d
  add    %r8,%rbx
  mov    $0xffffffff,%r8d
L261:
  movzbl 0x1b(%rsp),%eax
  test   %al,%al
  je     L360
  mov    %al,(%rbx)
  lea    0x1(%rbx),%rbx
L360:
  cmpl   $0x0,0x1c(%rsp)
  je     L312
  cmp    $0x8,%r14d
  je     L385
  cmp    $0x10,%r14d
  je     L160
L312:
  test   $0x10,%r12b
  jne    L21
  lea    -0x1(%r8),%eax
  test   %r8d,%r8d
  jle    L53
  mov    %r8d,%ecx
  add    %rbx,%rcx
  mov    %rbx,%rax
L85:
  add    $0x1,%rax
  mov    %r13b,-0x1(%rax)
  cmp    %rcx,%rax
  jne    L85
  mov    %r8d,%r8d
  add    %r8,%rbx
  mov    $0xffffffff,%r8d
L21:
  cmp    %edx,%esi
  jge    L364
  sub    %esi,%edx
  lea    -0x1(%rdx),%eax
  lea    0x1(%rbx,%rax,1),%rcx
L32:
  add    $0x1,%rbx
  movb   $0x30,-0x1(%rbx)
  cmp    %rcx,%rbx
  jne    L32
L55:
  test   %esi,%esi
  jle    L136
  movslq %esi,%rax
  lea    0x30(%rsp,%rax,1),%rdx
  mov    %esi,%r9d
  add    %rcx,%r9
  mov    %rcx,%rax
L366:
  add    $0x1,%rax
  movzbl -0x1(%rdx),%edi
  mov    %dil,-0x1(%rax)
  sub    $0x1,%rdx
  cmp    %r9,%rax
  jne    L366
  mov    %esi,%esi
  add    %rsi,%rcx
L136:
  test   %r8d,%r8d
  jle    L128
  mov    %r8d,%edx
  add    %rcx,%rdx
  mov    %rcx,%rax
L45:
  add    $0x1,%rax
  movb   $0x20,-0x1(%rax)
  cmp    %rdx,%rax
  jne    L45
  mov    %r8d,%r8d
  add    %r8,%rcx
L128:
  mov    0x78(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L388
  mov    %rcx,%rax
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L280:
  movb   $0x2d,0x1b(%rsp)
  jmp    L192
L198:
  subl   $0x2,0x10(%rsp)
  jmp    L153
L104:
  mov    %r14d,%esi
  mov    0x20(%rsp),%rdi
  mov    $0x0,%eax
  call   <__div64_32@plt>
  mov    %eax,%edx
L212:
  mov    %ebp,%esi
  mov    %edx,%edx
  movzbl (%r15,%rdx,1),%eax
  mov    %al,0x2f(%rsp,%rbp,1)
  mov    0x28(%rsp),%rax
  add    $0x1,%rbp
  test   %rax,%rax
  je     L322
L108:
  mov    %rax,%rsi
  shr    $0x20,%rsi
  jne    L104
  mov    $0x0,%edx
  divl   0xc(%rsp)
  mov    %eax,%eax
  mov    %rax,0x28(%rsp)
  jmp    L212
L81:
  mov    %eax,%r8d
  jmp    L261
L385:
  movb   $0x30,(%rbx)
  lea    0x1(%rbx),%rbx
  jmp    L312
L160:
  movb   $0x30,(%rbx)
  movzbl 0x21(%r15),%eax
  mov    %al,0x1(%rbx)
  lea    0x2(%rbx),%rbx
  jmp    L312
L53:
  mov    %eax,%r8d
  jmp    L21
L364:
  mov    %rbx,%rcx
  jmp    L55
L304:
  mov    $0x0,%ecx
  jmp    L128
L388:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D5
type_guessed: string
name: read_data
arguments: label: D3
type_guessed: string

tool: D5: 0123456789abcdefghijklmnopqrstuvwxyz

tool: D3: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ

assistant: ```c
char *number(char *str, unsigned long long num, int base, int size, int precision, int type) {
  char c, sign, tmp[66];
  const char *digits = "0123456789abcdefghijklmnopqrstuvwxyz";
  int i;
  if (type & 64)
    digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  if (type & 16)
    type &= ~1;
  if (base < 2 || base > 36)
    return 0;
  c = (type & 1) ? '0' : ' ';
  sign = 0;
  if (type & 2) {
    if ((signed long long)num < 0) {
      sign = '-';
      num = -(signed long long)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[({
        unsigned int __base = (base);
        unsigned int __rem;
        (void)(((typeof((num)) *)0) == ((unsigned long long *)0));
        if (((num) >> 32) == 0) {
          __rem = (unsigned int)(num) % __base;
          (num) = (unsigned int)(num) / __base;
        } else
          __rem = __div64_32(&(num), __base);
        __rem;
      })];
    }
  if (i > precision)
    precision = i;
  size -= precision;
  if (!(type & (1 + 16)))
    while (size-- > 0)
      *str++ = ' ';
  if (sign)
    *str++ = sign;
  if (type & 32) {
    if (base == 8)
      *str++ = '0';
    else if (base == 16) {
      *str++ = '0';
      *str++ = digits[33];
    }
  }
  if (!(type & 16))
    while (size-- > 0)
      *str++ = c;
  while (i < precision--)
    *str++ = '0';
  while (i-- > 0)
    *str++ = tmp[i];
  while (size-- > 0)
    *str++ = ' ';
  return str;
}
```