user: Please show me the C implementation that matches the assembly code listed below:

```asm
<Mutation_int_Kpoint>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %edx,-0x54(%rbp)
  mov    %rcx,-0x60(%rbp)
  mov    %r8,-0x68(%rbp)
  mov    %r9d,-0x58(%rbp)
  movsd  %xmm0,-0x70(%rbp)
  mov    0x18(%rbp),%rax
  mov    %rax,-0x78(%rbp)
  mov    0x20(%rbp),%rax
  mov    %rax,-0x80(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x50(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x58(%rbp),%edx
  mov    -0x68(%rbp),%rsi
  lea    -0x34(%rbp),%rax
  movq   %rcx,%xmm0
  mov    %rax,%rdi
  call   <self_adj_index_search@plt>
  movl   $0x1,-0x2c(%rbp)
  jmp    L72
L100:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    -0x2c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x80(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x2c(%rbp)
L72:
  mov    -0x2c(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jle    L100
  cmpl   $0x2,0x10(%rbp)
  jne    L77
  mov    -0x54(%rbp),%eax
  mov    %eax,%esi
  mov    $0x1,%edi
  call   <integerrng@plt>
  mov    %eax,-0x28(%rbp)
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    $0x1,%edx
  sub    %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x54(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%esi
  mov    $0x1,%edi
  call   <integerrng@plt>
  mov    %eax,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L125
  addl   $0x1,-0x2c(%rbp)
L125:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    $0x1,%edx
  sub    %ecx,%edx
  mov    %edx,(%rax)
  jmp    L76
L77:
  movl   $0x1,-0x2c(%rbp)
  jmp    L64
L99:
  mov    -0x54(%rbp),%eax
  mov    %eax,%esi
  mov    $0x1,%edi
  call   <integerrng@plt>
  mov    %eax,-0x28(%rbp)
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    $0x1,%edx
  sub    %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x2c(%rbp)
L64:
  mov    -0x2c(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jle    L99
L76:
  mov    -0x54(%rbp),%edx
  mov    -0x80(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <cost@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x58(%rbp),%edx
  mov    -0x68(%rbp),%rsi
  mov    -0x20(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  movq   %rcx,%xmm0
  mov    %rax,%rdi
  call   <self_adj_index_search@plt>
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D7(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  -0x20(%rbp),%xmm1
  movapd %xmm1,%xmm2
  divsd  -0x70(%rbp),%xmm2
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x50(%rbp),%rax
  movsd  (%rax),%xmm0
  divsd  -0x70(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x18(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L11
  mov    D12(%rip),%rax
  jmp    L136
L11:
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  call   <exp@plt>
  movq   %xmm0,%rax
L136:
  mov    -0x78(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    $0x0,%eax
  call   <uniformrng@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x78(%rbp),%rax
  movsd  (%rax),%xmm0
  comisd -0x10(%rbp),%xmm0
  ja     L105
  jmp    L118
L105:
  mov    -0x50(%rbp),%rax
  movsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  movl   $0x1,-0x2c(%rbp)
  jmp    L22
L32:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    -0x2c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x48(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x2c(%rbp)
L22:
  mov    -0x2c(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jle    L32
L118:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L83
  call   <__stack_chk_fail@plt>
L83:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D7
type_infered: f32[2]
name: unpack_data
arguments: data_label: D12
type_infered: f64

tool: {"D7": [0.0,-0.0]}

tool: D12: 1

assistant: ```c
void Mutation_int_Kpoint(int *z, double *fz, int N_dimension, double *theta, double *grid_points, int grid_size, double temp, int K, double *accpr_pop, int *z_new) {
  int k_old;
  int k_new;
  int i;
  int lab;
  int lab2;
  double fz_new;
  double rat;
  double un;
  self_adj_index_search(&k_old, *fz, grid_points, grid_size);
  for (i = 1; i <= N_dimension; i++)
    z_new[i] = z[i];
  if (K == 2) {
    lab = integerrng(1, N_dimension);
    z_new[lab] = 1 - z_new[lab];
    lab2 = integerrng(1, N_dimension - 1);
    if (lab2 >= lab)
      i++;
    z_new[lab2] = 1 - z_new[lab2];
  } else {
    for (i = 1; i <= K; i++) {
      lab = integerrng(1, N_dimension);
      z_new[lab] = 1 - z_new[lab];
    }
  }
  fz_new = cost(z_new, N_dimension);
  self_adj_index_search(&k_new, fz_new, grid_points, grid_size);
  rat = -theta[k_new] - fz_new / temp + theta[k_old] + *fz / temp;
  *accpr_pop = ((rat > 0.0) ? 1.0 : exp(rat));
  un = uniformrng();
  if (*accpr_pop > un) {
    *fz = fz_new;
    for (i = 1; i <= N_dimension; i++)
      z[i] = z_new[i];
  }
}
```