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

```asm
<karatsuba>:
  endbr64
  movslq %ecx,%r11
  push   %r15
  push   %r14
  lea    0x0(,%r11,4),%r10
  push   %r13
  mov    %r11,%r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  push   %rbx
  mov    %r11d,%ebx
  shr    $0x1f,%ebx
  add    %r11d,%ebx
  sar    %ebx
  sub    $0x78,%rsp
  movslq %ebx,%rax
  mov    %r10,0x48(%rsp)
  mov    %rax,0x18(%rsp)
  shl    $0x2,%rax
  mov    %rax,0x20(%rsp)
  lea    (%rdi,%rax,1),%r8
  lea    (%rsi,%rax,1),%r15
  lea    (%r11,%r11,4),%eax
  movslq %eax,%rcx
  add    %ebx,%eax
  cltq
  mov    %rcx,0x30(%rsp)
  shl    $0x2,%rcx
  lea    (%r12,%rax,4),%rax
  add    %rcx,%rdx
  mov    %rax,0x10(%rsp)
  mov    %r11,%rax
  shl    $0x4,%rax
  mov    %rdx,0x8(%rsp)
  sub    %rax,%rdx
  lea    (%r11,%r11,1),%eax
  cltq
  lea    (%rdx,%r10,1),%rbp
  mov    %rax,0x28(%rsp)
  shl    $0x2,%rax
  mov    %rax,0x50(%rsp)
  cmp    $0x4,%r11d
  jle    L172
  mov    0x20(%rsp),%r9
  mov    %rdx,%r14
  mov    0x18(%rsp),%rax
  add    0x30(%rsp),%rax
  lea    0x4(%r9),%rdx
  mov    %rax,0x58(%rsp)
  lea    (%r12,%rax,4),%rax
  lea    (%rdi,%rdx,1),%r10
  mov    %rdx,0x60(%rsp)
  lea    (%r11,%r11,2),%rdx
  mov    %r10,0x40(%rsp)
  lea    0x4(%rdi),%r10
  lea    0x0(%rbp,%rdx,4),%rdx
  mov    %r10,0x38(%rsp)
  lea    0x10(%r12,%rcx,1),%r10
  lea    -0x4(%r9),%rcx
  cmp    $0x8,%rcx
  seta   %r9b
  cmp    $0x3,%r11d
  setg   %cl
  and    %ecx,%r9d
  mov    %rdx,%rcx
  sub    0x38(%rsp),%rcx
  cmp    $0x8,%rcx
  seta   %cl
  and    %ecx,%r9d
  lea    0x10(%rsi),%rcx
  cmp    %rcx,%rdx
  setae  %cl
  cmp    %r10,%rsi
  setae  0x6f(%rsp)
  or     0x6f(%rsp),%cl
  and    %r9d,%ecx
  mov    0x20(%rsp),%r9
  lea    0x10(%rsi,%r9,1),%r9
  cmp    %r9,%rdx
  setae  %r9b
  cmp    %r10,%r15
  setae  %r10b
  or     %r10d,%r9d
  mov    %rax,%r10
  and    %ecx,%r9d
  mov    %rax,%rcx
  sub    0x40(%rsp),%rcx
  cmp    $0x8,%rcx
  seta   %cl
  and    %ecx,%r9d
  mov    0x60(%rsp),%rcx
  add    %rsi,%rcx
  sub    %rcx,%r10
  cmp    $0x8,%r10
  lea    0x4(%rsi),%r10
  seta   %cl
  and    %r9d,%ecx
  mov    %rax,%r9
  sub    0x38(%rsp),%r9
  cmp    $0x8,%r9
  seta   %r9b
  and    %r9d,%ecx
  mov    %rax,%r9
  sub    %r10,%r9
  cmp    $0x8,%r9
  seta   %r9b
  test   %r9b,%cl
  je     L112
  mov    %rdx,%rcx
  sub    0x40(%rsp),%rcx
  cmp    $0x8,%rcx
  jbe    L112
  cmp    $0x1,%r11d
  mov    $0x1,%r9d
  cmovg  %ebx,%r9d
  cmp    $0x7,%r11d
  jle    L32
  mov    %r9d,%r10d
  xor    %ecx,%ecx
  shr    $0x2,%r10d
  shl    $0x4,%r10
  nop
L9:
  movdqu (%r8,%rcx,1),%xmm0
  movdqu (%rdi,%rcx,1),%xmm5
  paddd  %xmm5,%xmm0
  movups %xmm0,(%rdx,%rcx,1)
  movdqu (%r15,%rcx,1),%xmm0
  movdqu (%rsi,%rcx,1),%xmm6
  paddd  %xmm6,%xmm0
  movups %xmm0,(%rax,%rcx,1)
  add    $0x10,%rcx
  cmp    %r10,%rcx
  jne    L9
  mov    %r9d,%edx
  and    $0xfffffffc,%edx
  mov    %edx,%eax
  cmp    %edx,%r9d
  je     L127
L144:
  sub    %edx,%r9d
  cmp    $0x1,%r9d
  je     L189
  mov    0x18(%rsp),%rcx
  movq   (%rdi,%rdx,4),%xmm1
  lea    (%rcx,%rdx,1),%r10
  mov    0x30(%rsp),%rcx
  movq   (%rdi,%r10,4),%xmm0
  add    %rdx,%rcx
  paddd  %xmm1,%xmm0
  movq   %xmm0,(%r12,%rcx,4)
  movq   (%rsi,%rdx,4),%xmm1
  movq   (%rsi,%r10,4),%xmm0
  add    0x58(%rsp),%rdx
  paddd  %xmm1,%xmm0
  movq   %xmm0,(%r12,%rdx,4)
  mov    %r9d,%edx
  and    $0xfffffffe,%edx
  add    %edx,%eax
  cmp    %edx,%r9d
  je     L127
L189:
  cltq
  mov    0x8(%rsp),%rcx
  mov    (%rdi,%rax,4),%edx
  add    (%r8,%rax,4),%edx
  mov    %edx,(%rcx,%rax,4)
  mov    0x10(%rsp),%rcx
  mov    (%rsi,%rax,4),%edx
  add    (%r15,%rax,4),%edx
  mov    %edx,(%rcx,%rax,4)
L127:
  mov    %ebx,%ecx
  mov    %r12,%rdx
  mov    %r11,0x38(%rsp)
  mov    %r8,0x30(%rsp)
  call   <karatsuba>
  mov    0x30(%rsp),%rdi
  mov    %ebx,%ecx
  mov    %r14,%rdx
  mov    %r15,%rsi
  call   <karatsuba>
  mov    0x8(%rsp),%rdi
  mov    %rbp,%rdx
  mov    %ebx,%ecx
  mov    0x10(%rsp),%rsi
  call   <karatsuba>
  mov    0x48(%rsp),%rax
  mov    0x50(%rsp),%rdi
  mov    0x38(%rsp),%r11
  add    $0x4,%rax
  mov    %rdi,%rdx
  sub    %rax,%rdx
  cmp    $0x8,%rdx
  jbe    L66
  mov    %rdi,%rax
  sub    $0x4,%rax
  cmp    $0x8,%rax
  jbe    L66
  mov    %r13d,%edx
  xor    %eax,%eax
  shr    $0x2,%edx
  shl    $0x4,%rdx
  nopl   0x0(%rax)
L87:
  movdqu 0x0(%rbp,%rax,1),%xmm0
  movdqu (%r12,%rax,1),%xmm2
  movdqu (%r14,%rax,1),%xmm3
  psubd  %xmm2,%xmm0
  psubd  %xmm3,%xmm0
  movups %xmm0,0x0(%rbp,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L87
  mov    %r13d,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%r13b
  je     L118
  mov    %r13d,%ecx
  sub    %eax,%ecx
  cmp    $0x1,%ecx
  je     L205
  mov    0x28(%rsp),%rsi
  mov    %eax,%edi
  movq   (%r12,%rdi,4),%xmm1
  lea    (%rsi,%rdi,1),%rdx
  lea    (%r12,%rdx,4),%rsi
  sub    %r11,%rdx
  movq   (%rsi),%xmm0
  psubd  %xmm1,%xmm0
  movq   (%r12,%rdx,4),%xmm1
  mov    %ecx,%edx
  and    $0xfffffffe,%edx
  add    %edx,%eax
  psubd  %xmm1,%xmm0
  movq   %xmm0,(%rsi)
  cmp    %edx,%ecx
  je     L118
L205:
  cltq
  lea    0x0(%rbp,%rax,4),%rcx
  mov    (%rcx),%edx
  sub    (%r12,%rax,4),%edx
  sub    (%r14,%rax,4),%edx
  mov    %edx,(%rcx)
L118:
  mov    0x18(%rsp),%rax
  sub    0x28(%rsp),%rax
  lea    -0x4(,%rax,4),%rax
  cmp    $0x8,%rax
  jbe    L55
  mov    0x20(%rsp),%rdx
  mov    %r13d,%ecx
  xor    %eax,%eax
  shr    $0x2,%ecx
  add    %r12,%rdx
  shl    $0x4,%rcx
  nopw   0x0(%rax,%rax,1)
L38:
  movdqu (%rdx,%rax,1),%xmm0
  movdqu 0x0(%rbp,%rax,1),%xmm4
  paddd  %xmm4,%xmm0
  movups %xmm0,(%rdx,%rax,1)
  add    $0x10,%rax
  cmp    %rcx,%rax
  jne    L38
  mov    %r13d,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%r13b
  je     L109
  sub    %eax,%r13d
  cmp    $0x1,%r13d
  je     L168
  mov    0x18(%rsp),%rdx
  mov    %eax,%esi
  add    %rsi,%rdx
  lea    (%r12,%rdx,4),%rcx
  mov    0x28(%rsp),%rdx
  movq   (%rcx),%xmm1
  add    %rsi,%rdx
  movq   (%r12,%rdx,4),%xmm0
  mov    %r13d,%edx
  and    $0xfffffffe,%edx
  paddd  %xmm1,%xmm0
  add    %edx,%eax
  movq   %xmm0,(%rcx)
  cmp    %edx,%r13d
  je     L109
L168:
  add    %eax,%ebx
  cltq
  movslq %ebx,%rbx
  mov    0x0(%rbp,%rax,4),%eax
  add    %eax,(%r12,%rbx,4)
L109:
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L172:
  add    $0x78,%rsp
  mov    %r12,%rdx
  mov    %r11d,%ecx
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1050 <gradeSchool@plt>
  nopl   0x0(%rax)
L55:
  add    0x20(%rsp),%r12
  xor    %eax,%eax
  nop
L91:
  mov    0x0(%rbp,%rax,4),%edx
  add    %edx,(%r12,%rax,4)
  add    $0x1,%rax
  cmp    %r11,%rax
  jne    L91
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L66:
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L236:
  mov    0x0(%rbp,%rax,4),%edx
  sub    (%r12,%rax,4),%edx
  sub    (%r14,%rax,4),%edx
  mov    %edx,0x0(%rbp,%rax,4)
  add    $0x1,%rax
  cmp    %r11,%rax
  jne    L236
  jmp    L118
  cs nopw 0x0(%rax,%rax,1)
L112:
  mov    0x8(%rsp),%rcx
  mov    0x10(%rsp),%r9
  xor    %eax,%eax
  nopl   0x0(%rax)
L70:
  mov    (%rdi,%rax,4),%edx
  add    (%r8,%rax,4),%edx
  mov    %edx,(%rcx,%rax,4)
  mov    (%rsi,%rax,4),%edx
  add    (%r15,%rax,4),%edx
  mov    %edx,(%r9,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jg     L70
  jmp    L127
L32:
  xor    %edx,%edx
  xor    %eax,%eax
  jmp    L144
```

assistant: ```c
void karatsuba(int *a, int *b, int *ret, int d) {
  int i;
  int *ar = &a[0];
  int *al = &a[d / 2];
  int *br = &b[0];
  int *bl = &b[d / 2];
  int *asum = &ret[d * 5];
  int *bsum = &ret[d * 5 + d / 2];
  int *x1 = &ret[d * 0];
  int *x2 = &ret[d * 1];
  int *x3 = &ret[d * 2];
  if (d <= 4) {
    gradeSchool(a, b, ret, d);
    return;
  }
  for (i = 0; i < d / 2; i++) {
    asum[i] = al[i] + ar[i];
    bsum[i] = bl[i] + br[i];
  }
  karatsuba(ar, br, x1, d / 2);
  karatsuba(al, bl, x2, d / 2);
  karatsuba(asum, bsum, x3, d / 2);
  for (i = 0; i < d; i++)
    x3[i] = x3[i] - x1[i] - x2[i];
  for (i = 0; i < d; i++)
    ret[i + d / 2] += x3[i];
}
```