user: Translate the below assembly code into C programming language:

```asm
<shuffle_classes>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %rdx,-0x30(%rbp)
  mov    %rcx,-0x38(%rbp)
  movl   $0x0,-0x14(%rbp)
  mov    -0x28(%rbp),%eax
  mov    $0x4,%esi
  mov    %eax,%edi
  call   <my_calloc@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L10
  mov    $0x2,%eax
  jmp    L16
L10:
  mov    -0x28(%rbp),%eax
  mov    $0x4,%esi
  mov    %eax,%edi
  call   <my_calloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L156
  mov    $0x2,%eax
  jmp    L16
L156:
  movl   $0x0,-0x1c(%rbp)
  jmp    L38
L121:
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%edi
  call   <random_long@plt>
  mov    %eax,-0x18(%rbp)
  addl   $0x1,-0x1c(%rbp)
L38:
  mov    -0x1c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L121
  movl   $0x0,-0x1c(%rbp)
  jmp    L159
L9:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movl   $0xffffffff,(%rax)
  addl   $0x1,-0x1c(%rbp)
L159:
  mov    -0x1c(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L9
  movl   $0x0,-0x1c(%rbp)
  jmp    L152
L142:
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%edi
  call   <random_long@plt>
  mov    %eax,-0x18(%rbp)
  jmp    L29
L108:
  mov    -0x18(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x28(%rbp)
  jle    L131
  addl   $0x1,-0x18(%rbp)
  jmp    L29
L131:
  movl   $0x0,-0x18(%rbp)
L29:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0xffffffff,%eax
  jne    L108
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x1c(%rbp)
L152:
  mov    -0x1c(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L142
  movl   $0x0,-0x1c(%rbp)
  jmp    L47
L12:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x1c(%rbp)
L47:
  mov    -0x1c(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L12
  mov    -0x30(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x38(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x14(%rbp),%eax
L16:
  leave
  ret
```

assistant: ```c
int shuffle_classes(int a_seed, int a_num_classes, int **a_table, int **inverted_table) {
  int the_error = 0;
  int *t, *inv_t;
  int i, j;
  t = (int *)my_calloc((a_num_classes), sizeof(int));
  if (t == NULL)
    return 2;
  inv_t = (int *)my_calloc((a_num_classes), sizeof(int));
  if (inv_t == NULL)
    return 2;
  for (i = 0; i < a_seed; i++)
    j = random_long(a_num_classes - 1);
  for (i = 0; i < a_num_classes; i++)
    t[i] = -1;
  for (i = 0; i < a_num_classes; i++) {
    j = random_long(a_num_classes - 1);
    while (t[j] != -1)
      if (j + 1 < a_num_classes)
        j += 1;
      else
        j = 0;
    t[j] = i;
  }
  for (i = 0; i < a_num_classes; i++)
    inv_t[t[i]] = i;
  *a_table = t;
  *inverted_table = inv_t;
  return the_error;
}
```