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

```asm
<todegree>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  movslq %edx,%rbx
  mov    %rbx,%rbp
  sub    $0x48,%rsp
  mov    %rdi,0x18(%rsp)
  lea    0x0(,%rbx,8),%rdi
  mov    %ecx,0x20(%rsp)
  mov    %r8d,0x24(%rsp)
  call   <malloc@plt>
  mov    %rax,%r14
  test   %ebx,%ebx
  jle    L211
  lea    -0x1(%rbp),%eax
  mov    %ebp,%r12d
  mov    %ebp,0x8(%rsp)
  shl    $0x2,%rbx
  mov    %eax,0x10(%rsp)
  lea    (%r14,%r12,8),%rax
  mov    %r14,%rbp
  mov    %rax,%r15
  nopl   (%rax)
L258:
  mov    %rbx,%rdi
  add    $0x8,%rbp
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmp    %r15,%rbp
  jne    L258
  mov    0x8(%rsp),%ebp
  mov    %r13,0x28(%rsp)
  xor    %esi,%esi
  mov    0x18(%rsp),%r13
  mov    %ebp,%eax
  mov    %ebp,%r9d
  shr    $0x2,%eax
  and    $0xfffffffc,%r9d
  lea    -0x1(%rax),%ebx
  lea    0x1(%r9),%r10d
  mov    %r9d,%r8d
  lea    0x2(%r9),%r11d
  add    $0x1,%rbx
  mov    %r10d,0x8(%rsp)
  shl    $0x2,%r8
  mov    %r11d,0xc(%rsp)
  shl    $0x4,%rbx
  shl    $0x2,%r10
  shl    $0x2,%r11
  nopl   (%rax)
L118:
  mov    0x0(%r13,%rsi,8),%rax
  mov    (%r14,%rsi,8),%rdx
  cmpl   $0x2,0x10(%rsp)
  lea    0x4(%rax),%rdi
  mov    %rdx,%rcx
  seta   %r15b
  sub    %rdi,%rcx
  cmp    $0x8,%rcx
  jbe    L237
  xor    %ecx,%ecx
  test   %r15b,%r15b
  je     L237
  nopl   0x0(%rax)
L48:
  movdqu (%rax,%rcx,1),%xmm0
  movups %xmm0,(%rdx,%rcx,1)
  add    $0x10,%rcx
  cmp    %rbx,%rcx
  jne    L48
  cmp    %ebp,%r9d
  je     L114
  mov    (%rax,%r8,1),%ecx
  mov    %ecx,(%rdx,%r8,1)
  cmp    0x8(%rsp),%ebp
  jle    L114
  mov    (%rax,%r10,1),%ecx
  mov    %ecx,(%rdx,%r10,1)
  cmp    0xc(%rsp),%ebp
  jle    L114
  mov    (%rax,%r11,1),%eax
  mov    %eax,(%rdx,%r11,1)
L114:
  add    $0x1,%rsi
  cmp    %r12,%rsi
  jne    L118
  mov    %r14,%rsi
  mov    %ebp,%ecx
  mov    %r14,%rdx
  mov    %r14,%rdi
  xor    %eax,%eax
  mov    %r8,0x38(%rsp)
  mov    0x28(%rsp),%r13
  mov    %r11,0x30(%rsp)
  mov    %r9d,0x18(%rsp)
  mov    %r10,0x10(%rsp)
  call   <multy@plt>
  mov    0x38(%rsp),%r8
  mov    0x30(%rsp),%r11
  xor    %esi,%esi
  mov    0x18(%rsp),%r9d
  mov    0x10(%rsp),%r10
  nopl   (%rax)
L248:
  mov    (%r14,%rsi,8),%rax
  mov    0x0(%r13,%rsi,8),%rdx
  lea    0x4(%rax),%rdi
  mov    %rdx,%rcx
  sub    %rdi,%rcx
  cmp    $0x8,%rcx
  jbe    L146
  xor    %ecx,%ecx
  test   %r15b,%r15b
  je     L146
  nopl   0x0(%rax,%rax,1)
L101:
  movdqu (%rax,%rcx,1),%xmm1
  movups %xmm1,(%rdx,%rcx,1)
  add    $0x10,%rcx
  cmp    %rbx,%rcx
  jne    L101
  cmp    %ebp,%r9d
  je     L110
  mov    (%rax,%r8,1),%ecx
  mov    %ecx,(%rdx,%r8,1)
  cmp    0x8(%rsp),%ebp
  jle    L110
  mov    (%rax,%r10,1),%ecx
  mov    %ecx,(%rdx,%r10,1)
  cmp    0xc(%rsp),%ebp
  jle    L110
  mov    (%rax,%r11,1),%eax
  mov    %eax,(%rdx,%r11,1)
L110:
  add    $0x1,%rsi
  cmp    %r12,%rsi
  jne    L248
  mov    0x20(%rsp),%edx
  test   %edx,%edx
  jle    L195
L233:
  mov    0x20(%rsp),%r12d
  mov    0x24(%rsp),%r15d
  mov    $0x1,%ebx
  nopl   0x0(%rax,%rax,1)
L76:
  mov    %r15d,%r8d
  mov    %ebp,%ecx
  mov    %r13,%rdx
  mov    %r13,%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x1,%ebx
  call   <block_mult_ed@plt>
  cmp    %ebx,%r12d
  jge    L76
  test   %ebp,%ebp
  jle    L38
L195:
  xor    %ebx,%ebx
  nopl   0x0(%rax,%rax,1)
L255:
  mov    (%r14,%rbx,8),%rdi
  add    $0x1,%rbx
  call   <free@plt>
  cmp    %ebx,%ebp
  jg     L255
L38:
  mov    %r14,%rdi
  call   <free@plt>
  add    $0x48,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L146:
  xor    %ecx,%ecx
  nopw   0x0(%rax,%rax,1)
L182:
  mov    (%rax,%rcx,4),%edi
  mov    %edi,(%rdx,%rcx,4)
  add    $0x1,%rcx
  cmp    %r12,%rcx
  jne    L182
  jmp    L110
  nopl   0x0(%rax)
L237:
  xor    %ecx,%ecx
  nopw   0x0(%rax,%rax,1)
L72:
  mov    (%rax,%rcx,4),%edi
  mov    %edi,(%rdx,%rcx,4)
  add    $0x1,%rcx
  cmp    %r12,%rcx
  jne    L72
  jmp    L114
L211:
  mov    %rax,%rdx
  mov    %rax,%rsi
  mov    %rax,%rdi
  mov    %ebx,%ecx
  xor    %eax,%eax
  call   <multy@plt>
  mov    0x20(%rsp),%eax
  test   %eax,%eax
  jg     L233
  jmp    L38
```

assistant: ```c
int todegree(int **input, int **out, int size, int degree, int param) {
  int i, j;
  int **temp = (int **)malloc(size * sizeof(int *));
  for (i = 0; i < size; i++)
    temp[i] = (int *)malloc(size * sizeof(int));
  for (i = 0; i < size; i++)
    for (j = 0; j < size; j++)
      temp[i][j] = input[i][j];
  multy(temp, temp, temp, size);
  for (i = 0; i < size; i++)
    for (j = 0; j < size; j++)
      out[i][j] = temp[i][j];
  for (i = 1; i <= degree; i++)
    block_mult_ed(temp, out, out, size, param);
  for (i = 0; i < size; i++)
    free(temp[i]);
  free(temp);
  return 0;
}
```