user: 请从给定的汇编指令推导出C源代码：

```asm
<test_get_bonded_neighbors>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  movl   $0x12,0xc(%rsp)
  movl   $0x12,0x10(%rsp)
  mov    D15(%rip),%rax
  mov    %rax,0x18(%rsp)
  cmp    $0x2,%edi
  jle    L74
  mov    %rsi,%r14
  lea    0x10(%rsi),%rbx
  lea    -0x3(%rdi),%eax
  lea    0x18(%rsi,%rax,8),%r13
  lea    D29(%rip),%r12
  lea    D72(%rip),%r15
  jmp    L152
L39:
  lea    0x18(%rsp),%rdx
  lea    D75(%rip),%rsi
  mov    (%rbx),%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  cmp    $0x1,%eax
  jne    L45
L124:
  add    $0x8,%rbx
  cmp    %r13,%rbx
  je     L31
L152:
  lea    0xc(%rsp),%rdx
  mov    %r12,%rsi
  mov    (%rbx),%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L124
  lea    0x10(%rsp),%rdx
  mov    %r15,%rsi
  mov    (%rbx),%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L124
  lea    0xc(%rsp),%rdx
  lea    D67(%rip),%rsi
  mov    (%rbx),%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  cmp    $0x1,%eax
  jne    L39
  mov    0xc(%rsp),%eax
  mov    %eax,0x10(%rsp)
  jmp    L124
L45:
  mov    0x8(%r14),%rsi
  mov    $0x0,%edx
  mov    (%r14),%rdi
  call   <usage@plt>
  jmp    L124
L31:
  cmpl   $0x2,0xc(%rsp)
  jle    L155
  cmpl   $0x2,0x10(%rsp)
  jg     L74
L155:
  mov    0x8(%r14),%rsi
  mov    $0x1,%edx
  mov    (%r14),%rdi
  call   <usage@plt>
L74:
  mov    $0x0,%edx
  mov    0x10(%rsp),%esi
  mov    0xc(%rsp),%edi
  call   <allocate_matrix@plt>
  mov    %rax,%r13
  mov    $0x0,%edx
  mov    0x10(%rsp),%esi
  mov    0xc(%rsp),%edi
  call   <allocate_matrix@plt>
  mov    %rax,%r12
  mov    $0x2e,%edx
  mov    0x10(%rsp),%esi
  mov    0xc(%rsp),%edi
  call   <allocate_matrix@plt>
  mov    %rax,%r14
  lea    0x28(%rsp),%rbp
  lea    0x20(%rsp),%rbx
  mov    0x10(%rsp),%ecx
  mov    0xc(%rsp),%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <set_A1_A2@plt>
  movsd  0x18(%rsp),%xmm0
  mov    0x10(%rsp),%ecx
  mov    0xc(%rsp),%edx
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <populate_bonds@plt>
  sub    $0x8,%rsp
  push   %rbp
  mov    %rbx,%r9
  mov    0x20(%rsp),%r8d
  mov    0x1c(%rsp),%ecx
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    %r14,%rdi
  call   <print_lattice@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x8,%rsp
  lea    0x1c(%rsp),%rax
  push   %rax
  lea    0x40(%rsp),%r9
  mov    %rbx,%r8
  mov    0x20(%rsp),%ecx
  mov    0x1c(%rsp),%edx
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <get_bonded_neighbors@plt>
  mov    0x34(%rsp),%edx
  mov    0x30(%rsp),%esi
  lea    D11(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x10,%rsp
  cmpl   $0x0,0x14(%rsp)
  je     L50
L120:
  cmpl   $0x0,0x14(%rsp)
  jle    L22
  lea    0x30(%rsp),%rbx
  mov    $0x0,%ebp
  lea    D12(%rip),%r15
L132:
  mov    0x4(%rbx),%edx
  mov    (%rbx),%esi
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%ebp
  add    $0x8,%rbx
  cmp    %ebp,0x14(%rsp)
  jg     L132
L22:
  mov    0x10(%rsp),%edx
  mov    0xc(%rsp),%esi
  mov    %r13,%rdi
  call   <free_matrix@plt>
  mov    0x10(%rsp),%edx
  mov    0xc(%rsp),%esi
  mov    %r12,%rdi
  call   <free_matrix@plt>
  mov    0x10(%rsp),%edx
  mov    0xc(%rsp),%esi
  mov    %r14,%rdi
  call   <free_matrix@plt>
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L16
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L50:
  lea    D49(%rip),%rdi
  call   <puts@plt>
  jmp    L120
L16:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D15
type: f64
name: retrieve_data
arguments: tag: D29
type: string
name: retrieve_data
arguments: tag: D72
type: string
name: retrieve_data
arguments: tag: D75
type: string
name: retrieve_data
arguments: tag: D67
type: string
name: retrieve_data
arguments: tag: D11
type: string
name: retrieve_data
arguments: tag: D12
type: string
name: retrieve_data
arguments: tag: D49
type: string

tool: D15: 0.6

tool: D29: M=%d

tool: D72: N=%d

tool: D75: p=%lf

tool: D67: MN=%d

tool: D11: Bonded neighbors of A1 at (%d, %d):


tool: D12:   ( %3d, %3d )


tool: D49: (none)

assistant: ```c
void test_get_bonded_neighbors(int argc, char **argv) {
  int M = 18;
  int N = 18;
  double p = 0.6;
  int argi;
  int **vbonds;
  int **hbonds;
  int **site_marks;
  int A1[2];
  int A2[2];
  int neighbors[4][2];
  int numnei;
  int k;
  for (argi = 2; argi < argc; argi++) {
    if (sscanf(argv[argi], "M=%d", &M) == 1)
      ;
    else if (sscanf(argv[argi], "N=%d", &N) == 1)
      ;
    else if (sscanf(argv[argi], "MN=%d", &M) == 1)
      N = M;
    else if (sscanf(argv[argi], "p=%lf", &p) == 1)
      ;
    else
      usage(argv[0], argv[1], 0);
  }
  if ((M < 3) || (N < 3))
    usage(argv[0], argv[1], 1);
  vbonds = allocate_matrix(M, N, 0);
  hbonds = allocate_matrix(M, N, 0);
  site_marks = allocate_matrix(M, N, '.');
  set_A1_A2(A1, A2, M, N);
  populate_bonds(vbonds, hbonds, M, N, p);
  print_lattice(site_marks, vbonds, hbonds, M, N, A1, A2);
  printf("\n");
  get_bonded_neighbors(vbonds, hbonds, M, N, A1, neighbors, &numnei);
  printf("Bonded neighbors of A1 at (%d, %d):\n", A1[0], A1[1]);
  if (numnei == 0)
    printf("(none)\n");
  for (k = 0; k < numnei; k++) {
    printf("  ( %3d, %3d )\n", neighbors[k][0], neighbors[k][1]);
  }
  free_matrix(vbonds, M, N);
  free_matrix(hbonds, M, N);
  free_matrix(site_marks, M, N);
}
```