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

```asm
<number>:
  endbr64
  push   %r15
  mov    %rdx,%rax
  push   %r14
  push   %r13
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  push   %rbx
  sub    $0xd8,%rsp
  movdqa D25(%rip),%xmm0
  mov    %fs:0x28,%rcx
  mov    %rcx,0xc8(%rsp)
  xor    %ecx,%ecx
  mov    0x110(%rsp),%edx
  lea    0x20(%rsp),%rcx
  lea    0x50(%rsp),%rbp
  movaps %xmm0,0x20(%rsp)
  movdqa D15(%rip),%xmm0
  test   $0x40,%dl
  mov    %edx,%ebx
  movl   $0x7a797877,0x40(%rsp)
  movaps %xmm0,0x30(%rsp)
  movdqa D22(%rip),%xmm0
  cmove  %rcx,%rbp
  and    $0x10,%ebx
  movb   $0x0,0x44(%rsp)
  lea    -0x2(%r12),%ecx
  movaps %xmm0,0x50(%rsp)
  movdqa D17(%rip),%xmm0
  movl   $0x5a595857,0x70(%rsp)
  movb   $0x0,0x74(%rsp)
  mov    %ebx,0xc(%rsp)
  movaps %xmm0,0x60(%rsp)
  je     L248
  and    $0xfffffffe,%edx
  cmp    $0x22,%ecx
  ja     L6
  mov    %edx,%r14d
  mov    %ebx,0x14(%rsp)
  mov    $0x20,%r13d
  and    $0x20,%r14d
  test   $0x2,%dl
  je     L484
L159:
  test   %rax,%rax
  js     L11
  test   $0x4,%dl
  jne    L326
  and    $0x8,%edx
  movb   $0x0,0x13(%rsp)
  je     L164
  movb   $0x20,0x13(%rsp)
  sub    $0x1,%r8d
  jmp    L164
  nopl   (%rax)
L248:
  cmp    $0x22,%ecx
  ja     L6
  mov    %edx,%ecx
  mov    %edx,%ebx
  mov    %edx,%r14d
  and    $0x1,%ecx
  and    $0x11,%ebx
  cmp    $0x1,%ecx
  mov    %ebx,0x14(%rsp)
  sbb    %r13d,%r13d
  and    $0x20,%r14d
  and    $0xfffffff0,%r13d
  add    $0x30,%r13d
  test   $0x2,%dl
  jne    L159
L484:
  movb   $0x0,0x13(%rsp)
L164:
  test   %r14d,%r14d
  je     L258
L365:
  cmp    $0x10,%r12d
  je     L150
  xor    %edx,%edx
  cmp    $0x8,%r12d
  sete   %dl
  sub    %edx,%r8d
L258:
  test   %rax,%rax
  jne    L156
  lea    0x80(%rsp),%rax
  movb   $0x30,0x80(%rsp)
  xor    %r15d,%r15d
  mov    $0x1,%ecx
  mov    %rax,0x18(%rsp)
L342:
  cmp    %r9d,%ecx
  mov    0x14(%rsp),%edx
  cmovge %ecx,%r9d
  sub    %r9d,%r8d
  test   %edx,%edx
  jne    L390
  lea    -0x1(%r8),%eax
  test   %r8d,%r8d
  jle    L85
  movslq %r8d,%r8
  add    %rdi,%r8
  nopl   0x0(%rax)
L26:
  cmp    %rdi,%rsi
  jb     L299
  movb   $0x20,(%rdi)
L299:
  add    $0x1,%rdi
  cmp    %r8,%rdi
  jne    L26
  mov    $0xffffffff,%r8d
L390:
  movzbl 0x13(%rsp),%eax
  test   %al,%al
  je     L121
  cmp    %rsi,%rdi
  ja     L240
  mov    %al,(%rdi)
L240:
  add    $0x1,%rdi
L121:
  test   %r14d,%r14d
  je     L69
  cmp    $0x8,%r12d
  je     L353
  cmp    $0x10,%r12d
  je     L348
L69:
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jne    L86
  lea    -0x1(%r8),%eax
  test   %r8d,%r8d
  jle    L181
  movslq %r8d,%r8
  add    %rdi,%r8
  nop
L316:
  cmp    %rdi,%rsi
  jb     L76
  mov    %r13b,(%rdi)
L76:
  add    $0x1,%rdi
  cmp    %r8,%rdi
  jne    L316
  mov    $0xffffffff,%r8d
L86:
  cmp    %r9d,%ecx
  jge    L277
  sub    %ecx,%r9d
  lea    -0x1(%r9),%eax
  lea    0x1(%rdi,%rax,1),%rdx
  nopl   0x0(%rax)
L58:
  cmp    %rdi,%rsi
  jb     L295
  movb   $0x30,(%rdi)
L295:
  add    $0x1,%rdi
  cmp    %rdi,%rdx
  jne    L58
L207:
  mov    0x18(%rsp),%rcx
  movslq %r15d,%rax
  lea    0x1(%r15),%r10d
  lea    (%r10,%rdx,1),%r9d
  add    %rax,%rcx
  mov    %rdx,%rax
  nopw   0x0(%rax,%rax,1)
L232:
  cmp    %rax,%rsi
  jb     L439
  movzbl (%rcx),%edi
  mov    %dil,(%rax)
L439:
  add    $0x1,%rax
  mov    %r9d,%edi
  sub    $0x1,%rcx
  sub    %eax,%edi
  test   %edi,%edi
  jg     L232
  movslq %r10d,%r10
  add    %r10,%rdx
  test   %r8d,%r8d
  jle    L468
  movslq %r8d,%r8
  lea    (%rdx,%r8,1),%rax
  nopw   0x0(%rax,%rax,1)
L191:
  cmp    %rdx,%rsi
  jb     L2
  movb   $0x20,(%rdx)
L2:
  add    $0x1,%rdx
  cmp    %rdx,%rax
  jne    L191
L378:
  mov    0xc8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L187
  add    $0xd8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L11:
  movb   $0x2d,0x13(%rsp)
  neg    %rax
  sub    $0x1,%r8d
  test   %r14d,%r14d
  jne    L365
L156:
  lea    0x80(%rsp),%rbx
  mov    %r12d,%r11d
  xor    %ecx,%ecx
  mov    %rbx,0x18(%rsp)
  mov    %rbx,%r10
  nopw   0x0(%rax,%rax,1)
L144:
  xor    %edx,%edx
  mov    %rax,%rbx
  mov    %ecx,%r15d
  add    $0x1,%r10
  div    %r11
  add    $0x1,%ecx
  movzbl 0x0(%rbp,%rdx,1),%edx
  mov    %dl,-0x1(%r10)
  cmp    %r11,%rbx
  jae    L144
  jmp    L342
  nopl   (%rax)
L326:
  movb   $0x2b,0x13(%rsp)
  sub    $0x1,%r8d
  jmp    L164
  xchg   %ax,%ax
L348:
  cmp    %rsi,%rdi
  ja     L40
  movb   $0x30,(%rdi)
L40:
  lea    0x1(%rdi),%rax
  cmp    %rax,%rsi
  jb     L486
  movzbl 0x21(%rbp),%eax
  mov    %al,0x1(%rdi)
L486:
  add    $0x2,%rdi
  jmp    L69
  nopl   0x0(%rax)
L6:
  xor    %eax,%eax
  jmp    L378
  nop
L150:
  sub    $0x2,%r8d
  jmp    L258
  nopl   0x0(%rax)
L353:
  cmp    %rsi,%rdi
  ja     L395
  movb   $0x30,(%rdi)
L395:
  add    $0x1,%rdi
  jmp    L69
  nopl   0x0(%rax)
L468:
  mov    %rdx,%rax
  jmp    L378
L277:
  mov    %rdi,%rdx
  jmp    L207
L181:
  mov    %eax,%r8d
  jmp    L86
L85:
  mov    %eax,%r8d
  jmp    L390
L187:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D25
type_infered: byte[16]
name: unpack_data
arguments: label: D15
type_infered: byte[16]
name: unpack_data
arguments: label: D22
type_infered: byte[16]
name: unpack_data
arguments: label: D17
type_infered: byte[16]

tool: {"D25": [0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x61,0x62,0x63,0x64,0x65,0x66]}

tool: {"D15": [0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0x75,0x76]}

tool: {"D22": [0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x41,0x42,0x43,0x44,0x45,0x46]}

tool: {"D17": [0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x55,0x56]}

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;
}
```