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

```asm
<_bucket_sort>:
  endbr64
  push   %rbp
  mov    %esi,%r8d
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x58,%rsp
  mov    (%rdi),%r15d
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  movslq %esi,%rax
  mov    %rsp,%rcx
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L6
L155:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L155
L6:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L123
L177:
  mov    %rsp,%rsi
  test   %r8d,%r8d
  jle    L33
  lea    -0x1(%r8),%edx
  lea    0x4(%rdi),%rax
  lea    (%rax,%rdx,4),%rcx
  mov    %r15d,%edx
  jmp    L15
  nopl   (%rax)
L55:
  mov    (%rax),%edx
  add    $0x4,%rax
L15:
  cmp    %edx,%r15d
  cmovl  %edx,%r15d
  cmp    %rax,%rcx
  jne    L55
L33:
  test   %r15d,%r15d
  jle    L3
  lea    -0x1(%r8),%eax
  mov    $0x1,%ebx
  lea    -0x38(%rbp),%r13
  mov    %rax,%r12
  lea    0x4(%rdi,%rax,4),%r14
  lea    0x4(,%rax,4),%rax
  mov    %rax,-0x80(%rbp)
  lea    -0x5c(%rbp),%rax
  mov    %rax,-0x78(%rbp)
  nopl   0x0(%rax)
L162:
  pxor   %xmm0,%xmm0
  movq   $0x0,-0x40(%rbp)
  movaps %xmm0,-0x60(%rbp)
  movaps %xmm0,-0x50(%rbp)
  test   %r8d,%r8d
  jle    L89
  mov    %rdi,%rcx
  nopl   0x0(%rax,%rax,1)
L95:
  mov    (%rcx),%eax
  add    $0x4,%rcx
  cltd
  idiv   %ebx
  movslq %eax,%rdx
  mov    %eax,%r10d
  imul   $0x66666667,%rdx,%rdx
  sar    $0x1f,%r10d
  sar    $0x22,%rdx
  sub    %r10d,%edx
  lea    (%rdx,%rdx,4),%r10d
  add    %r10d,%r10d
  sub    %r10d,%eax
  movslq %eax,%rdx
  addl   $0x1,-0x60(%rbp,%rdx,4)
  cmp    %rcx,%r14
  jne    L95
  mov    -0x5c(%rbp),%edx
  mov    -0x60(%rbp),%ecx
L76:
  mov    -0x78(%rbp),%rax
  jmp    L173
  nopl   0x0(%rax)
L167:
  mov    (%rax),%edx
  mov    -0x4(%rax),%ecx
L173:
  add    %ecx,%edx
  add    $0x4,%rax
  mov    %edx,-0x4(%rax)
  cmp    %r13,%rax
  jne    L167
  movslq %r12d,%rcx
  test   %r12d,%r12d
  js     L31
  nopl   0x0(%rax,%rax,1)
L43:
  mov    (%rdi,%rcx,4),%r10d
  sub    $0x1,%rcx
  mov    %r10d,%eax
  cltd
  idiv   %ebx
  movslq %eax,%rdx
  mov    %eax,%r11d
  imul   $0x66666667,%rdx,%rdx
  sar    $0x1f,%r11d
  sar    $0x22,%rdx
  sub    %r11d,%edx
  lea    (%rdx,%rdx,4),%r11d
  add    %r11d,%r11d
  sub    %r11d,%eax
  movslq %eax,%rdx
  mov    -0x60(%rbp,%rdx,4),%eax
  sub    $0x1,%eax
  mov    %eax,-0x60(%rbp,%rdx,4)
  cltq
  mov    %r10d,(%rsi,%rax,4)
  test   %ecx,%ecx
  jns    L43
L31:
  test   %r8d,%r8d
  jle    L176
  mov    -0x80(%rbp),%rdx
  mov    %r8d,-0x6c(%rbp)
  mov    %rsi,-0x68(%rbp)
  call   <memcpy@plt>
  mov    -0x68(%rbp),%rsi
  mov    -0x6c(%rbp),%r8d
  mov    %rax,%rdi
L176:
  mov    %r15d,%eax
  lea    (%rbx,%rbx,4),%ebx
  add    %ebx,%ebx
  cltd
  idiv   %ebx
  test   %eax,%eax
  jne    L162
L3:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L81
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L89:
  xor    %ecx,%ecx
  xor    %edx,%edx
  jmp    L76
L123:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L177
L81:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void _bucket_sort(int *vet, int s) {
  int i;
  int max = vet[0];
  int exp = 1;
  int sorted[s];
  for (i = 0; i < s; i++)
    if (vet[i] > max)
      max = vet[i];
  while (max / exp > 0) {
    int buckets[10] = {0};
    for (i = 0; i < s; i++)
      buckets[(vet[i] / exp) % 10]++;
    for (i = 1; i < 10; i++)
      buckets[i] += buckets[i - 1];
    for (i = s - 1; i >= 0; i--)
      sorted[--buckets[(vet[i] / exp) % 10]] = vet[i];
    for (i = 0; i < s; i++)
      vet[i] = sorted[i];
    exp *= 10;
  }
}
```