user: Converte this assembly snippet into its equivalent C code:

```asm
<number>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %ecx,(%rsp)
  mov    %r8d,0x4(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  mov    %r9d,%r13d
  and    $0x20,%r13d
  mov    %r9d,%eax
  and    $0xfffffffe,%eax
  test   $0x10,%r9b
  cmovne %eax,%r9d
  lea    -0x2(%rdx),%eax
  cmp    $0xe,%eax
  ja     L182
  mov    %edx,%r12d
  mov    %r9d,%eax
  and    $0x1,%eax
  cmp    $0x1,%eax
  sbb    %ebp,%ebp
  and    $0xfffffff0,%ebp
  add    $0x30,%ebp
  test   $0x2,%r9b
  je     L321
  test   %rsi,%rsi
  js     L375
  test   $0x4,%r9b
  je     L204
  subl   $0x1,(%rsp)
  movb   $0x2b,0xb(%rsp)
  jmp    L349
L375:
  neg    %rsi
  sub    $0x1,%ecx
  mov    %ecx,(%rsp)
  mov    %r9d,%eax
  and    $0x40,%eax
  mov    %eax,0xc(%rsp)
  jne    L133
  movb   $0x2d,0xb(%rsp)
L58:
  mov    $0x1,%r8d
  mov    %r12d,%ecx
  lea    0xf(%rsp),%r15
  lea    D3(%rip),%r14
L55:
  mov    %rsi,%rbx
  mov    %rsi,%rax
  mov    $0x0,%edx
  div    %rcx
  mov    %rax,%r10
  mov    %rax,%rsi
  mov    %r8d,%r11d
  mov    %rbx,%rax
  mov    $0x0,%edx
  div    %rcx
  movslq %edx,%rdx
  mov    %r13d,%eax
  or     (%r14,%rdx,1),%al
  mov    %al,(%r15,%r8,1)
  add    $0x1,%r8
  test   %r10,%r10
  jne    L55
  jmp    L20
L204:
  movb   $0x0,0xb(%rsp)
  test   $0x8,%r9b
  je     L349
  subl   $0x1,(%rsp)
  movb   $0x20,0xb(%rsp)
  jmp    L349
L321:
  movb   $0x0,0xb(%rsp)
L349:
  mov    %r9d,%eax
  and    $0x40,%eax
  mov    %eax,0xc(%rsp)
  je     L91
L214:
  cmp    $0x10,%r12d
  je     L96
  cmp    $0x8,%r12d
  sete   %al
  movzbl %al,%eax
  sub    %eax,(%rsp)
L91:
  test   %rsi,%rsi
  jne    L58
  movb   $0x30,0x10(%rsp)
  mov    $0x1,%r11d
L20:
  mov    0x4(%rsp),%eax
  cmp    %eax,%r11d
  mov    %eax,%edx
  cmovge %r11d,%edx
  mov    (%rsp),%esi
  sub    %edx,%esi
  test   $0x11,%r9b
  jne    L171
  lea    -0x1(%rsi),%eax
  test   %esi,%esi
  jle    L46
  mov    %esi,%ecx
  add    %rdi,%rcx
  mov    %rdi,%rax
L179:
  add    $0x1,%rax
  movb   $0x20,-0x1(%rax)
  cmp    %rcx,%rax
  jne    L179
  mov    %esi,%esi
  add    %rsi,%rdi
  mov    $0xffffffff,%esi
L171:
  movzbl 0xb(%rsp),%eax
  test   %al,%al
  je     L247
  mov    %al,(%rdi)
  lea    0x1(%rdi),%rdi
L247:
  cmpl   $0x0,0xc(%rsp)
  je     L208
  cmp    $0x8,%r12d
  je     L70
  cmp    $0x10,%r12d
  je     L324
L208:
  test   $0x10,%r9b
  jne    L181
  lea    -0x1(%rsi),%eax
  test   %esi,%esi
  jle    L275
  mov    %esi,%ecx
  add    %rdi,%rcx
  mov    %rdi,%rax
L131:
  add    $0x1,%rax
  mov    %bpl,-0x1(%rax)
  cmp    %rcx,%rax
  jne    L131
  mov    %esi,%esi
  add    %rsi,%rdi
  mov    $0xffffffff,%esi
L181:
  cmp    %edx,%r11d
  jge    L248
  sub    %r11d,%edx
  lea    -0x1(%rdx),%eax
  lea    0x1(%rdi,%rax,1),%rcx
L22:
  add    $0x1,%rdi
  movb   $0x30,-0x1(%rdi)
  cmp    %rcx,%rdi
  jne    L22
L343:
  test   %r11d,%r11d
  jle    L338
  movslq %r11d,%rax
  lea    0x10(%rsp,%rax,1),%rdx
  mov    %r11d,%r8d
  add    %rcx,%r8
  mov    %rcx,%rax
L74:
  add    $0x1,%rax
  movzbl -0x1(%rdx),%edi
  mov    %dil,-0x1(%rax)
  sub    $0x1,%rdx
  cmp    %r8,%rax
  jne    L74
  mov    %r11d,%r11d
  add    %r11,%rcx
L338:
  test   %esi,%esi
  jle    L82
  mov    %esi,%edx
  add    %rcx,%rdx
  mov    %rcx,%rax
L322:
  add    $0x1,%rax
  movb   $0x20,-0x1(%rax)
  cmp    %rdx,%rax
  jne    L322
  mov    %esi,%esi
  add    %rsi,%rcx
L82:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L48
  mov    %rcx,%rax
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L133:
  movb   $0x2d,0xb(%rsp)
  jmp    L214
L96:
  subl   $0x2,(%rsp)
  jmp    L91
L46:
  mov    %eax,%esi
  jmp    L171
L70:
  movb   $0x30,(%rdi)
  lea    0x1(%rdi),%rdi
  jmp    L208
L324:
  movb   $0x30,(%rdi)
  or     $0x58,%r13d
  mov    %r13b,0x1(%rdi)
  lea    0x2(%rdi),%rdi
  jmp    L208
L275:
  mov    %eax,%esi
  jmp    L181
L248:
  mov    %rdi,%rcx
  jmp    L343
L182:
  mov    $0x0,%ecx
  jmp    L82
L48:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *number(char *str, long num, int base, int size, int precision, int type) {
  static const char digits[16] = "0123456789ABCDEF";
  char tmp[66];
  char c, sign, locase;
  int i;
  locase = (type & 32);
  if (type & 16)
    type &= ~1;
  if (base < 2 || base > 16)
    return ((void *)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 & 64) {
    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)base;
                    num = ((unsigned long)num) / (unsigned)base;
                    __res;
                  })] |
                  locase);
  if (i > precision)
    precision = i;
  size -= precision;
  if (!(type & (1 + 16)))
    while (size-- > 0)
      *str++ = ' ';
  if (sign)
    *str++ = sign;
  if (type & 64) {
    if (base == 8)
      *str++ = '0';
    else if (base == 16) {
      *str++ = '0';
      *str++ = ('X' | locase);
    }
  }
  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;
}
```