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    D57(%rip),%rax
  movl   $0x12,0x1c(%rsp)
  movl   $0x12,0x20(%rsp)
  mov    %rax,0x28(%rsp)
  cmp    $0x2,%edi
  jle    L111
  lea    -0x3(%rdi),%eax
  lea    0x10(%rsi),%r13
  lea    0x18(%rsi,%rax,8),%r12
  lea    0x1c(%rsp),%rbx
  lea    D69(%rip),%rbp
  lea    0x20(%rsp),%r15
  lea    D39(%rip),%r14
  jmp    L59
  nopw   0x0(%rax,%rax,1)
L90:
  mov    0x1c(%rsp),%eax
  mov    %eax,0x20(%rsp)
L122:
  add    $0x8,%r13
  cmp    %r12,%r13
  je     L157
L59:
  mov    0x0(%r13),%rdi
  xor    %eax,%eax
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L122
  mov    0x0(%r13),%rdi
  xor    %eax,%eax
  mov    %r15,%rdx
  mov    %r14,%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L122
  mov    0x0(%r13),%rdi
  xor    %eax,%eax
  mov    %rbx,%rdx
  lea    D1(%rip),%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L90
  mov    0x0(%r13),%rdi
  xor    %eax,%eax
  lea    0x28(%rsp),%rdx
  lea    D46(%rip),%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L122
  mov    0x8(%rsp),%rax
  xor    %edx,%edx
  add    $0x8,%r13
  mov    0x8(%rax),%rsi
  mov    (%rax),%rdi
  call   <usage@plt>
  cmp    %r12,%r13
  jne    L59
  nopl   0x0(%rax,%rax,1)
L157:
  mov    0x1c(%rsp),%edi
  cmp    $0x2,%edi
  jle    L1
  mov    0x20(%rsp),%esi
  cmp    $0x2,%esi
  jg     L11
L1:
  mov    0x8(%rsp),%rax
  mov    $0x1,%edx
  mov    0x8(%rax),%rsi
  mov    (%rax),%rdi
  call   <usage@plt>
  mov    0x20(%rsp),%esi
  mov    0x1c(%rsp),%edi
L11:
  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    D23(%rip),%rdi
  call   <printf@plt>
  mov    0x34(%rsp),%eax
  pop    %rdx
  pop    %rcx
  test   %eax,%eax
  je     L24
L114:
  xor    %ebp,%ebp
  lea    D51(%rip),%r15
  test   %eax,%eax
  jle    L52
L84:
  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     L84
L52:
  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    L21
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L24:
  lea    D21(%rip),%rdi
  call   <puts@plt>
  mov    0x24(%rsp),%eax
  jmp    L114
  nopl   (%rax)
L111:
  mov    $0x12,%edi
  mov    $0x12,%esi
  jmp    L11
L21:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D57
type_guessed: f64
name: disassemble_data
arguments: label: D69
type_guessed: string
name: disassemble_data
arguments: label: D39
type_guessed: string
name: disassemble_data
arguments: label: D1
type_guessed: string
name: disassemble_data
arguments: label: D46
type_guessed: string
name: disassemble_data
arguments: label: D23
type_guessed: string
name: disassemble_data
arguments: label: D51
type_guessed: string
name: disassemble_data
arguments: label: D21
type_guessed: string

tool: D57: 0.6

tool: D69: M=%d

tool: D39: N=%d

tool: D1: MN=%d

tool: D46: p=%lf

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


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


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