user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<Mutation_int_Gibbs>:
  endbr64
  push   %r15
  mov    %rdi,%r11
  mov    %r9d,%r15d
  push   %r14
  mov    %r8,%r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rcx,0x28(%rsp)
  mov    0xa8(%rsp),%rbp
  movsd  %xmm0,0x30(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  test   %edx,%edx
  jle    L15
  mov    %rbp,%rax
  sub    %rdi,%rax
  sub    $0x4,%rax
  cmp    $0x8,%rax
  jbe    L37
  lea    -0x1(%rdx),%eax
  cmp    $0x2,%eax
  jbe    L37
  mov    %edx,%eax
  shr    $0x2,%eax
  lea    -0x1(%rax),%edx
  mov    $0x4,%eax
  shl    $0x4,%rdx
  add    $0x14,%rdx
  nopl   0x0(%rax)
L19:
  movdqu (%r11,%rax,1),%xmm5
  movups %xmm5,0x0(%rbp,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L19
  mov    %r13d,%eax
  and    $0xfffffffc,%eax
  lea    0x1(%rax),%edx
  cmp    %eax,%r13d
  je     L15
  movslq %edx,%rdx
  mov    (%r11,%rdx,4),%esi
  lea    0x0(,%rdx,4),%rcx
  mov    %esi,0x0(%rbp,%rdx,4)
  lea    0x2(%rax),%edx
  cmp    %edx,%r13d
  jl     L15
  mov    0x4(%r11,%rcx,1),%edx
  add    $0x3,%eax
  mov    %edx,0x4(%rbp,%rcx,1)
  cmp    %eax,%r13d
  jl     L15
  mov    0x8(%r11,%rcx,1),%eax
  mov    %eax,0x8(%rbp,%rcx,1)
L15:
  mov    0xa0(%rsp),%eax
  test   %eax,%eax
  jle    L49
  lea    0x50(%rsp),%rax
  mov    %r11,0x48(%rsp)
  mov    $0x1,%r8d
  mov    %rax,0x38(%rsp)
  lea    0x54(%rsp),%rax
  mov    %rax,0x40(%rsp)
  jmp    L39
  nop
L125:
  movsd  0x18(%rsp),%xmm2
  mov    (%rbx),%eax
  add    $0x1,%r8d
  mov    0x48(%rsp),%rsi
  mov    0x20(%rsp),%r9
  movsd  %xmm2,(%r12)
  mov    %eax,(%rsi,%r9,4)
  cmp    %r8d,0xa0(%rsp)
  jl     L49
L39:
  mov    %r13d,%esi
  mov    $0x1,%edi
  mov    %r8d,0x14(%rsp)
  call   <integerrng@plt>
  mov    0x38(%rsp),%rdi
  mov    %r15d,%edx
  mov    %r14,%rsi
  movsd  (%r12),%xmm0
  mov    %eax,%ebx
  call   <self_adj_index_search@plt>
  movslq %ebx,%r9
  mov    $0x1,%eax
  mov    %r13d,%esi
  lea    0x0(%rbp,%r9,4),%rbx
  mov    %rbp,%rdi
  mov    %r9,0x20(%rsp)
  sub    (%rbx),%eax
  mov    %eax,(%rbx)
  call   <cost@plt>
  mov    0x40(%rsp),%rdi
  mov    %r15d,%edx
  mov    %r14,%rsi
  movsd  %xmm0,0x8(%rsp)
  call   <self_adj_index_search@plt>
  movsd  0x8(%rsp),%xmm2
  movsd  0x30(%rsp),%xmm4
  movsd  (%r12),%xmm1
  mov    0x28(%rsp),%rdi
  movapd %xmm2,%xmm0
  movslq 0x54(%rsp),%rax
  movsd  %xmm2,0x18(%rsp)
  divsd  %xmm4,%xmm0
  divsd  %xmm4,%xmm1
  addsd  (%rdi,%rax,8),%xmm0
  movslq 0x50(%rsp),%rax
  subsd  (%rdi,%rax,8),%xmm0
  subsd  %xmm1,%xmm0
  call   <exp@plt>
  xor    %eax,%eax
  movsd  %xmm0,0x8(%rsp)
  call   <uniformrng@plt>
  movsd  0x8(%rsp),%xmm1
  mov    0x14(%rsp),%r8d
  mov    $0x1,%ecx
  movapd %xmm0,%xmm3
  movsd  D8(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  D8(%rip),%xmm1
  divsd  %xmm0,%xmm1
  comisd %xmm3,%xmm1
  jae    L125
  sub    (%rbx),%ecx
  add    $0x1,%r8d
  mov    %ecx,(%rbx)
  cmp    %r8d,0xa0(%rsp)
  jge    L39
L49:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L80
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L37:
  lea    0x1(%r13),%ecx
  mov    $0x1,%eax
  nopl   0x0(%rax)
L65:
  mov    (%r11,%rax,4),%edx
  mov    %edx,0x0(%rbp,%rax,4)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L65
  jmp    L15
L80:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D8
type: f64

tool: D8: 1

assistant: ```c
void Mutation_int_Gibbs(int *z, double *fz, int N_dimension, double *theta, double *grid_points, int grid_size, double temp, int Krep, int *z_new) {
  int k_old;
  int k_new;
  int i;
  double Pr;
  int lab;
  int gg;
  double fz_new;
  double rat;
  double un;
  for (i = 1; i <= N_dimension; i++)
    z_new[i] = z[i];
  for (gg = 1; gg <= Krep; gg++) {
    lab = integerrng(1, N_dimension);
    self_adj_index_search(&k_old, *fz, grid_points, grid_size);
    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;
    Pr = 1.0 / (1.0 + exp(rat));
    un = uniformrng();
    if (Pr >= un) {
      *fz = fz_new;
      z[lab] = z_new[lab];
    } else {
      z_new[lab] = 1 - z_new[lab];
    }
  }
}
```