user: Demonstrate the C code that generates the assembly output below:

```asm
<assign_class_by_k_medoids>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  mov    %rcx,%r15
  push   %r14
  push   %r13
  mov    %edi,%r13d
  push   %r12
  mov    %esi,%r12d
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdx,-0x88(%rbp)
  mov    %r8,-0x58(%rbp)
  mov    %rsp,%rcx
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  movslq %esi,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L92
L127:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L127
L92:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L161
L63:
  movslq %r13d,%rax
  mov    %rsp,%rcx
  mov    %rsp,%r14
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L178
L141:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L141
L178:
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  jne    L139
L111:
  mov    %r15,%rdx
  mov    %r12d,%esi
  mov    %r13d,%edi
  mov    %rsp,-0x60(%rbp)
  movq   $0x0,-0x48(%rbp)
  lea    -0x1(%r12),%ebx
  movq   $0x0,-0x40(%rbp)
  call   <srswor@plt>
  mov    -0x58(%rbp),%r8
  lea    -0x48(%rbp),%r9
  mov    %r15,%rcx
  mov    -0x88(%rbp),%rdx
  mov    %r12d,%esi
  mov    %r13d,%edi
  call   <assign_class_id_compute_total_cost@plt>
  lea    0x4(,%rbx,4),%rax
  mov    %rbx,-0x90(%rbp)
  mov    -0x88(%rbp),%rbx
  mov    %rax,-0x78(%rbp)
  lea    -0x1(%r13),%eax
  mov    %rax,-0x98(%rbp)
  lea    0x4(,%rax,4),%rax
  mov    %rax,-0x80(%rbp)
  lea    -0x40(%rbp),%rax
  movl   $0x64,-0x6c(%rbp)
  mov    %rax,-0x68(%rbp)
  jmp    L154
  nopw   0x0(%rax,%rax,1)
L82:
  movsd  %xmm0,-0x48(%rbp)
  test   %r12d,%r12d
  jle    L1
  mov    -0x78(%rbp),%rdx
  mov    %r14,%rsi
  mov    %r15,%rdi
  call   <memcpy@plt>
L1:
  test   %r13d,%r13d
  jle    L55
  mov    -0x80(%rbp),%rdx
  mov    -0x60(%rbp),%rsi
  mov    -0x58(%rbp),%rdi
  call   <memcpy@plt>
L55:
  subl   $0x1,-0x6c(%rbp)
  je     L160
L154:
  mov    -0x58(%rbp),%r8
  mov    %r14,%r9
  mov    %r15,%rcx
  mov    %rbx,%rdx
  mov    %r12d,%esi
  mov    %r13d,%edi
  call   <classify_by_EDM@plt>
  mov    -0x68(%rbp),%r9
  mov    -0x60(%rbp),%r8
  mov    %r14,%rcx
  mov    %rbx,%rdx
  mov    %r12d,%esi
  mov    %r13d,%edi
  call   <assign_class_id_compute_total_cost@plt>
  movsd  -0x40(%rbp),%xmm0
  movsd  -0x48(%rbp),%xmm1
  comisd %xmm0,%xmm1
  ja     L82
L160:
  mov    -0x90(%rbp),%rbx
  test   %r13d,%r13d
  jle    L144
  mov    -0x58(%rbp),%rsi
  mov    -0x98(%rbp),%rax
  lea    0x4(%rsi,%rax,4),%rdi
  nopw   0x0(%rax,%rax,1)
L5:
  test   %r12d,%r12d
  jle    L115
  mov    (%rsi),%ecx
  xor    %eax,%eax
  jmp    L49
  nopl   0x0(%rax,%rax,1)
L41:
  lea    0x1(%rax),%rdx
  cmp    %rax,%rbx
  je     L115
  mov    %rdx,%rax
L49:
  cmp    (%r15,%rax,4),%ecx
  jne    L41
  mov    %eax,(%rsi)
L115:
  add    $0x4,%rsi
  cmp    %rdi,%rsi
  jne    L5
L144:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L90
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L161:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L63
L139:
  orq    $0x0,-0x8(%rsp,%rax,1)
  jmp    L111
L90:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void assign_class_by_k_medoids(int N_X, int K, double **EDM, int *center_id, int *class_id) {
  int max_kmed_iter = 100;
  int i, n_X, k;
  int new_center_id[K], new_class_id[N_X];
  double total_cost = 0.0, new_total_cost = 0.0;
  srswor(N_X, K, center_id);
  assign_class_id_compute_total_cost(N_X, K, EDM, center_id, class_id, &total_cost);
  for (i = 0; i < max_kmed_iter; i++) {
    classify_by_EDM(N_X, K, EDM, center_id, class_id, new_center_id);
    assign_class_id_compute_total_cost(N_X, K, EDM, new_center_id, new_class_id, &new_total_cost);
    if (new_total_cost < total_cost) {
      total_cost = new_total_cost;
      for (k = 0; k < K; k++) {
        center_id[k] = new_center_id[k];
      }
      for (n_X = 0; n_X < N_X; n_X++) {
        class_id[n_X] = new_class_id[n_X];
      }
    } else {
      break;
    }
  }
  for (n_X = 0; n_X < N_X; n_X++) {
    for (k = 0; k < K; k++) {
      if (class_id[n_X] == center_id[k]) {
        class_id[n_X] = k;
        break;
      }
    }
  }
}
```