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

```asm
<test_plot_lattice>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  mov    D30(%rip),%rax
  movl   $0xc8,0x18(%rsp)
  movl   $0xc8,0x1c(%rsp)
  mov    %rax,0x20(%rsp)
  cmp    $0x2,%edi
  jle    L38
  lea    -0x3(%rdi),%eax
  mov    %rsi,%r13
  lea    0x10(%rsi),%r15
  lea    0x18(%rsi,%rax,8),%r12
  lea    D72(%rip),%rax
  mov    %rax,0x8(%rsp)
  lea    0x18(%rsp),%rbx
  lea    D84(%rip),%rbp
  lea    D18(%rip),%r14
  jmp    L86
  nopw   0x0(%rax,%rax,1)
L62:
  mov    0x18(%rsp),%eax
  mov    %eax,0x1c(%rsp)
  nopl   0x0(%rax,%rax,1)
L118:
  add    $0x8,%r15
  cmp    %r12,%r15
  je     L55
L86:
  mov    (%r15),%rdi
  xor    %eax,%eax
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L118
  mov    (%r15),%rdi
  xor    %eax,%eax
  lea    0x1c(%rsp),%rdx
  mov    %r14,%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L118
  mov    (%r15),%rdi
  xor    %eax,%eax
  mov    %rbx,%rdx
  lea    D67(%rip),%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L62
  mov    (%r15),%rdi
  xor    %eax,%eax
  lea    0x20(%rsp),%rdx
  lea    D75(%rip),%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L118
  mov    (%r15),%rdi
  mov    $0x2,%edx
  lea    D78(%rip),%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L116
  mov    (%r15),%rax
  add    $0x8,%r15
  add    $0x2,%rax
  mov    %rax,0x8(%rsp)
  cmp    %r12,%r15
  jne    L86
  nopl   0x0(%rax,%rax,1)
L55:
  mov    0x18(%rsp),%edi
  cmp    $0x2,%edi
  jle    L69
  mov    0x1c(%rsp),%esi
  cmp    $0x2,%esi
  jg     L10
L69:
  mov    0x8(%r13),%rsi
  mov    0x0(%r13),%rdi
  mov    $0x1,%edx
  call   <usage@plt>
  mov    0x1c(%rsp),%esi
  mov    0x18(%rsp),%edi
L10:
  xor    %edx,%edx
  lea    0x28(%rsp),%rbx
  lea    0x30(%rsp),%r14
  call   <allocate_matrix@plt>
  mov    0x1c(%rsp),%esi
  mov    0x18(%rsp),%edi
  xor    %edx,%edx
  mov    %rax,%r12
  call   <allocate_matrix@plt>
  mov    0x1c(%rsp),%esi
  mov    0x18(%rsp),%edi
  mov    $0x2e,%edx
  mov    %rax,%rbp
  call   <allocate_matrix@plt>
  mov    0x1c(%rsp),%ecx
  mov    0x18(%rsp),%edx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  mov    %rax,%r13
  call   <set_A1_A2@plt>
  mov    0x1c(%rsp),%ecx
  mov    0x18(%rsp),%edx
  mov    %rbp,%rsi
  movsd  0x20(%rsp),%xmm0
  mov    %r12,%rdi
  call   <populate_bonds@plt>
  mov    0x8(%rsp),%r15
  mov    %rbx,%r9
  mov    %rbp,%rdx
  mov    %r12,%rsi
  mov    %r13,%rdi
  push   %r15
  push   %r14
  mov    0x2c(%rsp),%r8d
  mov    0x28(%rsp),%ecx
  call   <plot_lattice@plt>
  mov    %r15,%rsi
  lea    D10(%rip),%rdi
  call   <printf@plt>
  mov    0x2c(%rsp),%edx
  mov    0x28(%rsp),%esi
  mov    %r12,%rdi
  call   <free_matrix@plt>
  mov    0x2c(%rsp),%edx
  mov    0x28(%rsp),%esi
  mov    %rbp,%rdi
  call   <free_matrix@plt>
  mov    0x2c(%rsp),%edx
  mov    0x28(%rsp),%esi
  mov    %r13,%rdi
  call   <free_matrix@plt>
  pop    %rax
  pop    %rdx
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L79
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L116:
  mov    0x8(%r13),%rsi
  mov    0x0(%r13),%rdi
  xor    %edx,%edx
  call   <usage@plt>
  jmp    L118
  nopl   0x0(%rax)
L38:
  lea    D72(%rip),%rax
  mov    $0xc8,%edi
  mov    $0xc8,%esi
  mov    %rax,0x8(%rsp)
  jmp    L10
L79:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D30
datatype: f64
name: unpack_data
arguments: data_label: D72
datatype: string
name: unpack_data
arguments: data_label: D84
datatype: string
name: unpack_data
arguments: data_label: D18
datatype: string
name: unpack_data
arguments: data_label: D67
datatype: string
name: unpack_data
arguments: data_label: D75
datatype: string
name: unpack_data
arguments: data_label: D78
datatype: string
name: unpack_data
arguments: data_label: D10
datatype: string

tool: D30: 0.6

tool: D72: p2.ppm

tool: D84: M=%d

tool: D18: N=%d

tool: D67: MN=%d

tool: D75: p=%lf

tool: D78: f=

tool: D10: Wrote %s.


assistant: ```c
void test_plot_lattice(int argc, char **argv) {
  int M = 200;
  int N = 200;
  double p = 0.6;
  int argi;
  int **vbonds;
  int **hbonds;
  int **site_marks;
  int A1[2];
  int A2[2];
  char *image_file_name = "p2.ppm";
  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 if (strncmp(argv[argi], "f=", 2) == 0)
      image_file_name = &argv[argi][2];
    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);
  plot_lattice(site_marks, vbonds, hbonds, M, N, A1, A2, image_file_name);
  printf("Wrote %s.\n", image_file_name);
  free_matrix(vbonds, M, N);
  free_matrix(hbonds, M, N);
  free_matrix(site_marks, M, N);
}
```