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

```asm
<assign_class_by_pam>:
  endbr64
  push   %r15
  xor    %eax,%eax
  push   %r14
  push   %r13
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %r8,%rbx
  sub    $0x68,%rsp
  mov    %rdx,0x20(%rsp)
  mov    %esi,0x2c(%rsp)
  call   <allocate_double_1D@plt>
  mov    %r12d,%edi
  movslq %eax,%r11
  xor    %eax,%eax
  mov    %r11,0x8(%rsp)
  call   <allocate_double_1D@plt>
  mov    %r12d,%edi
  movslq %eax,%r10
  xor    %eax,%eax
  mov    %r10,0x18(%rsp)
  call   <allocate_double_1D@plt>
  mov    $0x1,%edi
  movslq %eax,%r14
  xor    %eax,%eax
  call   <allocate_double_1D@plt>
  mov    $0x2,%edi
  cltq
  mov    %rax,0x40(%rsp)
  xor    %eax,%eax
  call   <allocate_double_1D@plt>
  mov    %r12d,%edi
  cltq
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  call   <allocate_int_1D@plt>
  mov    %r12d,%edi
  movslq %eax,%r15
  xor    %eax,%eax
  call   <allocate_int_1D@plt>
  mov    %r12d,%edi
  cltq
  mov    %rax,0x10(%rsp)
  xor    %eax,%eax
  call   <allocate_int_1D@plt>
  mov    $0x1,%edi
  movslq %eax,%r13
  xor    %eax,%eax
  call   <allocate_int_1D@plt>
  movslq %eax,%rdx
  mov    %rdx,0x50(%rsp)
  mov    0x20(%rsp),%rdx
  mov    (%rdx),%rax
  lea    -0x8(%rax),%rdx
  mov    %rdx,0x58(%rsp)
  test   %r12d,%r12d
  jle    L38
  mov    0x8(%rsp),%r11
  mov    0x18(%rsp),%r10
  mov    %r12d,%edx
  lea    0x0(,%rdx,8),%rcx
  lea    0x0(,%rdx,4),%r8
  mov    0x10(%rsp),%rdx
  mov    %r11,%rdi
  mov    %r8,%r9
  mov    %r10,%rsi
  mov    %rcx,0x30(%rsp)
  add    %rcx,%rdi
  add    %rcx,%rsi
  add    %r8,%rdx
  add    %r14,%rcx
  mov    %r9,0x20(%rsp)
  add    %rbx,%r9
  cmp    %rdi,%r10
  lea    (%r8,%r15,1),%rax
  mov    %r9,0x38(%rsp)
  setae  %r9b
  cmp    %rsi,%r11
  lea    (%r8,%r13,1),%r8
  setae  %r10b
  or     %r10d,%r9d
  cmp    %rcx,%r11
  setae  %r10b
  cmp    %r14,%rdi
  setbe  %r11b
  or     %r11d,%r10d
  and    %r9d,%r10d
  cmp    %rax,0x8(%rsp)
  setae  %r9b
  cmp    %r15,%rdi
  setbe  %r11b
  or     %r11d,%r9d
  and    %r10d,%r9d
  cmp    %rdx,0x8(%rsp)
  setae  %r10b
  cmp    0x10(%rsp),%rdi
  setbe  %r11b
  or     %r11d,%r10d
  and    %r9d,%r10d
  cmp    %r8,0x8(%rsp)
  setae  %r9b
  cmp    %r13,%rdi
  setbe  %r11b
  or     %r11d,%r9d
  mov    0x8(%rsp),%r11
  and    %r10d,%r9d
  cmp    0x38(%rsp),%r11
  mov    0x18(%rsp),%r11
  setae  %r10b
  cmp    %rdi,%rbx
  setae  %dil
  or     %r10d,%edi
  and    %r9d,%edi
  cmp    %rcx,%r11
  setae  %r9b
  cmp    %r14,%rsi
  setbe  %r10b
  or     %r10d,%r9d
  and    %edi,%r9d
  cmp    %rax,%r11
  setae  %dil
  cmp    %r15,%rsi
  setbe  %r10b
  or     %r10d,%edi
  and    %r9d,%edi
  cmp    %rdx,%r11
  setae  %r9b
  cmp    0x10(%rsp),%rsi
  setbe  %r10b
  or     %r10d,%r9d
  and    %edi,%r9d
  cmp    %r8,%r11
  setae  %dil
  cmp    %r13,%rsi
  setbe  %r10b
  or     %r10d,%edi
  and    %edi,%r9d
  mov    %r9d,%r10d
  mov    %r11,%r9
  mov    0x38(%rsp),%r11
  cmp    %r11,%r9
  setae  %r9b
  cmp    %rsi,%rbx
  setae  %dil
  or     %r9d,%edi
  and    %r10d,%edi
  cmp    %rax,%r14
  mov    0x10(%rsp),%r10
  setae  %sil
  cmp    %r15,%rcx
  setbe  %r9b
  or     %r9d,%esi
  and    %edi,%esi
  cmp    %rdx,%r14
  setae  %dil
  cmp    %r10,%rcx
  setbe  %r9b
  or     %r9d,%edi
  and    %esi,%edi
  cmp    %r8,%r14
  setae  %sil
  cmp    %r13,%rcx
  setbe  %r9b
  or     %r9d,%esi
  and    %edi,%esi
  cmp    %r11,%r14
  setae  %dil
  cmp    %rcx,%rbx
  setae  %cl
  or     %edi,%ecx
  and    %esi,%ecx
  cmp    %rdx,%r15
  setae  %sil
  cmp    %r10,%rax
  setbe  %dil
  or     %edi,%esi
  and    %ecx,%esi
  cmp    %r8,%r15
  setae  %cl
  cmp    %r13,%rax
  setbe  %dil
  or     %edi,%ecx
  and    %ecx,%esi
  cmp    %r11,%r15
  mov    %esi,%edi
  setae  %sil
  cmp    %rax,%rbx
  setae  %cl
  or     %esi,%ecx
  and    %edi,%ecx
  cmp    %r8,%r10
  setae  %al
  cmp    %r13,%rdx
  setbe  %sil
  or     %esi,%eax
  and    %ecx,%eax
  cmp    %r11,%r10
  setae  %cl
  cmp    %rdx,%rbx
  setae  %sil
  or     %esi,%ecx
  test   %cl,%al
  je     L6
  cmp    %r11,%r13
  setae  %al
  cmp    %r8,%rbx
  setae  %cl
  or     %cl,%al
  je     L6
  mov    0x20(%rsp),%rdx
  xor    %esi,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    0x20(%rsp),%rdx
  xor    %esi,%esi
  mov    %r13,%rdi
  call   <memset@plt>
  mov    0x20(%rsp),%rdx
  mov    0x10(%rsp),%rdi
  xor    %esi,%esi
  call   <memset@plt>
  mov    0x20(%rsp),%rdx
  xor    %esi,%esi
  mov    %r15,%rdi
  call   <memset@plt>
  mov    0x30(%rsp),%rdx
  xor    %esi,%esi
  mov    %r14,%rdi
  call   <memset@plt>
  mov    0x30(%rsp),%rdx
  mov    0x18(%rsp),%rdi
  xor    %esi,%esi
  call   <memset@plt>
  mov    0x30(%rsp),%rdx
  mov    0x8(%rsp),%rdi
  xor    %esi,%esi
  call   <memset@plt>
L8:
  mov    0x2c(%rsp),%edx
  test   %edx,%edx
  jle    L113
  movslq 0x2c(%rsp),%rdx
  xor    %esi,%esi
  mov    %rbp,%rdi
  shl    $0x2,%rdx
  call   <memset@plt>
  mov    0x48(%rsp),%rax
  mov    0x40(%rsp),%rdx
  mov    0x50(%rsp),%rcx
  movq   $0x0,(%rdx)
  movq   $0x0,0x8(%rax)
  movq   $0x0,(%rax)
  movl   $0x1,(%rcx)
  push   %rcx
  push   %rbx
  push   %rbp
  push   %rax
  push   %rdx
L35:
  push   %r14
  mov    %r13,%r9
  mov    %r15,%rcx
  mov    %r12d,%edi
  push   0x48(%rsp)
  xor    %eax,%eax
  push   0x40(%rsp)
  mov    0x50(%rsp),%r8
  mov    0x98(%rsp),%rdx
  mov    0x6c(%rsp),%esi
  call   <phyclust_pam@plt>
  add    $0x40,%rsp
  xor    %eax,%eax
  nopl   0x0(%rax)
L104:
  subl   $0x1,(%rbx,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%r12d
  jg     L104
  mov    0x2c(%rsp),%ecx
  test   %ecx,%ecx
  jle    L42
L117:
  mov    0x2c(%rsp),%edx
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L116:
  subl   $0x1,0x0(%rbp,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%edx
  jg     L116
L42:
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    0x40(%rsp),%rdi
  call   <free@plt>
  mov    0x48(%rsp),%rdi
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    0x50(%rsp),%rdi
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <free@plt>
  nop
L38:
  mov    0x2c(%rsp),%eax
  test   %eax,%eax
  jle    L81
  movslq 0x2c(%rsp),%rdx
  xor    %esi,%esi
  mov    %rbp,%rdi
  shl    $0x2,%rdx
  call   <memset@plt>
  mov    0x48(%rsp),%rax
  mov    %r13,%r9
  mov    %r12d,%edi
  mov    0x40(%rsp),%rdx
  mov    0x50(%rsp),%rcx
  movq   $0x0,(%rdx)
  movq   $0x0,0x8(%rax)
  movq   $0x0,(%rax)
  movl   $0x1,(%rcx)
  push   %rcx
  mov    %r15,%rcx
  push   %rbx
  push   %rbp
  push   %rax
  xor    %eax,%eax
  push   %rdx
  push   %r14
  push   0x48(%rsp)
  push   0x40(%rsp)
  mov    0x50(%rsp),%r8
  mov    0x98(%rsp),%rdx
  mov    0x6c(%rsp),%esi
  call   <phyclust_pam@plt>
  add    $0x40,%rsp
  jmp    L117
L6:
  mov    0x10(%rsp),%r9
  mov    0x18(%rsp),%rsi
  mov    %rbx,%r10
  mov    %r15,%rdi
  mov    0x8(%rsp),%rcx
  mov    %r14,%rdx
  mov    %r13,%rax
  sub    %r13,%r10
  sub    %r13,%r9
  sub    %r13,%rdi
  sub    %r14,%rsi
  sub    %r14,%rcx
  nopl   (%rax)
L99:
  movl   $0x0,(%r10,%rax,1)
  movl   $0x0,(%rax)
  movl   $0x0,(%r9,%rax,1)
  movl   $0x0,(%rdi,%rax,1)
  add    $0x4,%rax
  movq   $0x0,(%rdx)
  movq   $0x0,(%rsi,%rdx,1)
  movq   $0x0,(%rcx,%rdx,1)
  add    $0x8,%rdx
  cmp    %r8,%rax
  jne    L99
  jmp    L8
L81:
  mov    0x48(%rsp),%rax
  mov    0x40(%rsp),%rsi
  mov    %r13,%r9
  mov    %r15,%rcx
  mov    0x50(%rsp),%rdx
  mov    %r12d,%edi
  movq   $0x0,(%rsi)
  movq   $0x0,0x8(%rax)
  movq   $0x0,(%rax)
  movl   $0x1,(%rdx)
  push   %rdx
  push   %rbx
  push   %rbp
  push   %rax
  xor    %eax,%eax
  push   %rsi
  push   %r14
  push   0x48(%rsp)
  push   0x40(%rsp)
  mov    0x50(%rsp),%r8
  mov    0x98(%rsp),%rdx
  mov    0x6c(%rsp),%esi
  call   <phyclust_pam@plt>
  add    $0x40,%rsp
  jmp    L42
L113:
  mov    0x48(%rsp),%rax
  mov    0x40(%rsp),%rsi
  mov    0x50(%rsp),%rdx
  movq   $0x0,(%rsi)
  movq   $0x0,0x8(%rax)
  movq   $0x0,(%rax)
  movl   $0x1,(%rdx)
  push   %rdx
  push   %rbx
  push   %rbp
  push   %rax
  push   %rsi
  jmp    L35
```

assistant: ```c
void assign_class_by_pam(int N_X, int K, double **EDM_LT_pam, int *center_id, int *class_id) {
  int i;
  double *dys, *radus, *damer, *avsyl, *ttsyl, *obj;
  int *nsend, *nrepr, *nelem, *nisol;
  radus = allocate_double_1D(N_X);
  damer = allocate_double_1D(N_X);
  avsyl = allocate_double_1D(N_X);
  ttsyl = allocate_double_1D(1);
  obj = allocate_double_1D(2);
  nsend = allocate_int_1D(N_X);
  nrepr = allocate_int_1D(N_X);
  nelem = allocate_int_1D(N_X);
  nisol = allocate_int_1D(1);
  dys = EDM_LT_pam[0] - 1;
  for (i = 0; i < N_X; i++) {
    nsend[i] = nrepr[i] = nelem[i] = class_id[i] = 0;
    radus[i] = damer[i] = avsyl[i] = 0;
  }
  for (i = 0; i < K; i++) {
    center_id[i] = 0;
  }
  ttsyl[0] = 0;
  obj[0] = obj[1] = 0;
  nisol[0] = 1;
  phyclust_pam(N_X, K, dys, nsend, nrepr, nelem, radus, damer, avsyl, ttsyl, obj, center_id, class_id, nisol);
  for (i = 0; i < N_X; i++) {
    class_id[i]--;
  }
  for (i = 0; i < K; i++) {
    center_id[i]--;
  }
  free(radus);
  free(damer);
  free(avsyl);
  free(ttsyl);
  free(obj);
  free(nsend);
  free(nrepr);
  free(nelem);
  free(nisol);
}
```