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

```asm
<sklansky>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %edi,%ebp
  mov    $0x100,%edi
  push   %rbx
  mov    %rdx,%rbx
  call   <malloc@plt>
  mov    %ebp,%r10d
  xor    %edx,%edx
  shl    $0x5,%r10d
  mov    %rax,%r9
  mov    %rax,%rdi
  movslq %r10d,%r10
  lea    (%r12,%r10,4),%rcx
  sub    %rcx,%r9
  jmp    L83
  nopl   (%rax)
L95:
  mov    (%rcx),%esi
L101:
  add    $0x1,%rdx
  mov    %esi,(%rcx,%r9,1)
  add    $0x4,%rcx
  cmp    $0x20,%rdx
  je     L70
L83:
  test   $0x1,%dl
  je     L95
  mov    %rdx,%r8
  mov    (%rcx),%esi
  and    $0xfffffffe,%r8d
  add    %r10,%r8
  add    (%r12,%r8,4),%esi
  jmp    L101
  nopl   0x0(%rax,%rax,1)
L70:
  mov    %rdi,%rcx
  xor    %edx,%edx
  nopl   (%rax)
L120:
  mov    (%rcx),%esi
  test   $0x2,%dl
  je     L87
  mov    %rdx,%r8
  and    $0xfffffffc,%r8d
  or     $0x1,%r8
  add    (%rdi,%r8,4),%esi
L87:
  add    $0x1,%rdx
  mov    %esi,0x80(%rcx)
  add    $0x4,%rcx
  cmp    $0x20,%rdx
  jne    L120
  lea    0x80(%rdi),%r8
  xor    %edx,%edx
  mov    %r8,%rcx
  jmp    L16
  nopl   0x0(%rax,%rax,1)
L46:
  mov    (%rcx),%esi
L68:
  add    $0x1,%rdx
  mov    %esi,-0x80(%rcx)
  add    $0x4,%rcx
  cmp    $0x20,%rdx
  je     L132
L16:
  test   $0x4,%dl
  je     L46
  mov    %rdx,%r9
  mov    (%rcx),%esi
  and    $0xfffffff8,%r9d
  or     $0x3,%r9
  add    0x80(%rdi,%r9,4),%esi
  jmp    L68
  nop
L132:
  mov    %rdi,%rcx
  xor    %edx,%edx
  nopl   (%rax)
L60:
  mov    (%rcx),%esi
  test   $0x8,%dl
  je     L91
  mov    %rdx,%r9
  and    $0xfffffff0,%r9d
  or     $0x7,%r9
  add    (%rdi,%r9,4),%esi
L91:
  add    $0x1,%rdx
  mov    %esi,0x80(%rcx)
  add    $0x4,%rcx
  cmp    $0x20,%rdx
  jne    L60
  mov    %r8,%rdx
  xor    %ecx,%ecx
  jmp    L80
  nopl   0x0(%rax)
L82:
  mov    (%rdx),%ecx
  mov    %ecx,-0x80(%rdx)
L19:
  add    $0x4,%rdx
  mov    %esi,%ecx
L80:
  lea    0x1(%rcx),%esi
  cmp    $0xf,%ecx
  jbe    L82
  mov    0xbc(%rdi),%ecx
  add    (%rdx),%ecx
  mov    %ecx,-0x80(%rdx)
  cmp    $0x20,%esi
  jne    L19
  shl    $0x5,%ebp
  movslq %ebp,%rdx
  shl    $0x2,%rdx
  sub    %rdi,%rdx
  add    %rdx,%rbx
  nopl   0x0(%rax,%rax,1)
L27:
  mov    (%rax),%edx
  mov    %edx,(%rbx,%rax,1)
  add    $0x4,%rax
  cmp    %rax,%r8
  jne    L27
  pop    %rbx
  pop    %rbp
  pop    %r12
  jmp    1060 <free@plt>
```

assistant: ```c
void sklansky(uint32_t bid, uint32_t *input0, uint32_t *result0) {
  unsigned char *sbase;
  sbase = (unsigned char *)malloc(256);
  for (uint32_t tid = 0; tid < 32; ++tid) {
    ((uint32_t *)sbase)[tid] = ((tid & 1) < 1) ? input0[((bid * 32) + ((tid & 4294967294) | (tid & 1)))] : (input0[((bid * 32) + ((tid & 4294967294) | (((tid & 1) - 1) + 1)))] + input0[((bid * 32) + ((tid & 4294967294) | 0))]);
  }
  for (uint32_t tid = 0; tid < 32; ++tid) {
    ((uint32_t *)(sbase + 128))[tid] = ((tid & 3) < 2) ? ((uint32_t *)sbase)[((tid & 4294967292) | (tid & 3))] : (((uint32_t *)sbase)[((tid & 4294967292) | (((tid & 3) - 2) + 2))] + ((uint32_t *)sbase)[((tid & 4294967292) | 1)]);
  }
  for (uint32_t tid = 0; tid < 32; ++tid) {
    ((uint32_t *)sbase)[tid] = ((tid & 7) < 4) ? ((uint32_t *)(sbase + 128))[((tid & 4294967288) | (tid & 7))] : (((uint32_t *)(sbase + 128))[((tid & 4294967288) | (((tid & 7) - 4) + 4))] + ((uint32_t *)(sbase + 128))[((tid & 4294967288) | 3)]);
  }
  for (uint32_t tid = 0; tid < 32; ++tid) {
    ((uint32_t *)(sbase + 128))[tid] = ((tid & 15) < 8) ? ((uint32_t *)sbase)[((tid & 4294967280) | (tid & 15))] : (((uint32_t *)sbase)[((tid & 4294967280) | (((tid & 15) - 8) + 8))] + ((uint32_t *)sbase)[((tid & 4294967280) | 7)]);
  }
  for (uint32_t tid = 0; tid < 32; ++tid) {
    ((uint32_t *)sbase)[tid] = (tid < 16) ? ((uint32_t *)(sbase + 128))[tid] : (((uint32_t *)(sbase + 128))[((tid - 16) + 16)] + ((uint32_t *)(sbase + 128))[15]);
  }
  for (uint32_t tid = 0; tid < 32; ++tid) {
    result0[((bid * 32) + tid)] = ((uint32_t *)sbase)[tid];
  }
  free(sbase);
}
```