user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<test_get_bonded_neighbors>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rsi,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  mov    D76(%rip),%rax
  movl   $0x12,0x1c(%rsp)
  movl   $0x12,0x20(%rsp)
  mov    %rax,0x28(%rsp)
  cmp    $0x2,%edi
  jle    L153
  lea    -0x3(%rdi),%eax
  lea    0x10(%rsi),%r13
  lea    0x18(%rsi,%rax,8),%r12
  lea    0x1c(%rsp),%rbx
  lea    D41(%rip),%rbp
  lea    0x20(%rsp),%r15
  lea    D38(%rip),%r14
  jmp    L42
  nopw   0x0(%rax,%rax,1)
L12:
  mov    0x1c(%rsp),%eax
  mov    %eax,0x20(%rsp)
L136:
  add    $0x8,%r13
  cmp    %r12,%r13
  je     L76
L42:
  mov    0x0(%r13),%rdi
  xor    %eax,%eax
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L136
  mov    0x0(%r13),%rdi
  xor    %eax,%eax
  mov    %r15,%rdx
  mov    %r14,%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L136
  mov    0x0(%r13),%rdi
  xor    %eax,%eax
  mov    %rbx,%rdx
  lea    D21(%rip),%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L12
  mov    0x0(%r13),%rdi
  xor    %eax,%eax
  lea    0x28(%rsp),%rdx
  lea    D43(%rip),%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L136
  mov    0x8(%rsp),%rax
  xor    %edx,%edx
  add    $0x8,%r13
  mov    0x8(%rax),%rsi
  mov    (%rax),%rdi
  call   <usage@plt>
  cmp    %r12,%r13
  jne    L42
  nopl   0x0(%rax,%rax,1)
L76:
  cmpl   $0x2,0x1c(%rsp)
  jle    L83
  mov    0x20(%rsp),%esi
  cmp    $0x2,%esi
  jg     L52
L83:
  mov    0x8(%rsp),%rax
  mov    $0x1,%edx
  mov    0x8(%rax),%rsi
  mov    (%rax),%rdi
  call   <usage@plt>
  mov    0x20(%rsp),%esi
L52:
  mov    0x1c(%rsp),%edi
  xor    %edx,%edx
  lea    0x38(%rsp),%rbx
  lea    0x30(%rsp),%rbp
  call   <allocate_matrix@plt>
  mov    0x20(%rsp),%esi
  mov    0x1c(%rsp),%edi
  xor    %edx,%edx
  mov    %rax,%r12
  call   <allocate_matrix@plt>
  mov    0x20(%rsp),%esi
  mov    0x1c(%rsp),%edi
  mov    $0x2e,%edx
  mov    %rax,%r13
  call   <allocate_matrix@plt>
  mov    0x20(%rsp),%ecx
  mov    0x1c(%rsp),%edx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  mov    %rax,%r14
  call   <set_A1_A2@plt>
  mov    0x1c(%rsp),%edx
  mov    0x20(%rsp),%ecx
  mov    %r13,%rsi
  movsd  0x28(%rsp),%xmm0
  mov    %r12,%rdi
  call   <populate_bonds@plt>
  sub    $0x8,%rsp
  mov    %rbp,%r9
  mov    %r13,%rdx
  push   %rbx
  mov    0x30(%rsp),%r8d
  mov    %r12,%rsi
  mov    %r14,%rdi
  mov    0x2c(%rsp),%ecx
  call   <print_lattice@plt>
  mov    $0xa,%edi
  lea    0x50(%rsp),%rbx
  call   <putchar@plt>
  pop    %rax
  mov    %rbx,%r9
  mov    %rbp,%r8
  lea    0x2c(%rsp),%rax
  mov    %r13,%rsi
  mov    %r12,%rdi
  push   %rax
  mov    0x30(%rsp),%ecx
  mov    0x2c(%rsp),%edx
  call   <get_bonded_neighbors@plt>
  mov    0x44(%rsp),%edx
  mov    0x40(%rsp),%esi
  xor    %eax,%eax
  lea    D46(%rip),%rdi
  call   <printf@plt>
  mov    0x34(%rsp),%eax
  pop    %rdx
  pop    %rcx
  test   %eax,%eax
  je     L72
L21:
  xor    %ebp,%ebp
  lea    D77(%rip),%r15
  test   %eax,%eax
  jle    L89
L70:
  mov    0x4(%rbx),%edx
  mov    (%rbx),%esi
  mov    %r15,%rdi
  xor    %eax,%eax
  add    $0x1,%ebp
  add    $0x8,%rbx
  call   <printf@plt>
  cmp    %ebp,0x24(%rsp)
  jg     L70
L89:
  mov    0x20(%rsp),%edx
  mov    0x1c(%rsp),%esi
  mov    %r12,%rdi
  call   <free_matrix@plt>
  mov    0x20(%rsp),%edx
  mov    0x1c(%rsp),%esi
  mov    %r13,%rdi
  call   <free_matrix@plt>
  mov    0x20(%rsp),%edx
  mov    0x1c(%rsp),%esi
  mov    %r14,%rdi
  call   <free_matrix@plt>
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L35
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L72:
  lea    D60(%rip),%rdi
  call   <puts@plt>
  mov    0x24(%rsp),%eax
  jmp    L21
  nopl   (%rax)
L153:
  mov    $0x12,%esi
  jmp    L52
L35:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D76
data_type: f64
name: retrieve_data
arguments: tag: D41
data_type: string
name: retrieve_data
arguments: tag: D38
data_type: string
name: retrieve_data
arguments: tag: D21
data_type: string
name: retrieve_data
arguments: tag: D43
data_type: string
name: retrieve_data
arguments: tag: D46
data_type: string
name: retrieve_data
arguments: tag: D77
data_type: string
name: retrieve_data
arguments: tag: D60
data_type: string

tool: D76: 0.6

tool: D41: M=%d

tool: D38: N=%d

tool: D21: MN=%d

tool: D43: p=%lf

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


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


tool: D60: (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);
}
```