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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    $0x4,%edi
  call   <nam_new@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  mov    -0x8(%rbp),%rax
  mov    $0x1,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <nam_add_edge@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <nam_add_edge@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x3,%edx
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <nam_add_edge@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x1,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <nam_test_edge@plt>
  test   %rax,%rax
  je     L4
  lea    D49(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L4:
  mov    -0x8(%rbp),%rax
  mov    $0x0,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <nam_test_edge@plt>
  test   %rax,%rax
  jne    L28
  lea    D34(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L28:
  mov    -0x8(%rbp),%rax
  mov    $0x1,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <nam_remove_edge@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x1,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <nam_test_edge@plt>
  test   %rax,%rax
  jne    L11
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L11:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <nam_size@plt>
  mov    %eax,-0xc(%rbp)
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x14(%rbp)
  jmp    L14
L27:
  movl   $0x0,-0x10(%rbp)
  jmp    L31
L34:
  mov    -0x10(%rbp),%edx
  mov    -0x14(%rbp),%ecx
  mov    -0x8(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <nam_test_edge@plt>
  test   %rax,%rax
  je     L45
  mov    -0x10(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %eax,%esi
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L45:
  addl   $0x1,-0x10(%rbp)
L31:
  mov    -0x10(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jl     L34
  addl   $0x1,-0x14(%rbp)
L14:
  mov    -0x14(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jl     L27
  mov    -0x8(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <nam_destroy@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D49
data_type: string
name: unpack_data
arguments: data_label: D34
data_type: string
name: unpack_data
arguments: data_label: D7
data_type: string
name: unpack_data
arguments: data_label: D11
data_type: string
name: unpack_data
arguments: data_label: D47
data_type: string

tool: D49: edge exists from 0 to 1

tool: D34: no edge exists from 1 to 0

tool: D7: removed edge from 0 to 1

tool: D11: 
list of all edges

tool: D47: %d -> %d


assistant: ```c
int main(void) {
  struct naive_adj_mat *nam = nam_new(4);
  int i = 0;
  int j = 0;
  int n = 0;
  nam_add_edge(nam, 0, 1);
  nam_add_edge(nam, 0, 2);
  nam_add_edge(nam, 2, 3);
  if (nam_test_edge(nam, 0, 1)) {
    puts("edge exists from 0 to 1");
  }
  if (!nam_test_edge(nam, 1, 0)) {
    puts("no edge exists from 1 to 0");
  }
  nam_remove_edge(nam, 0, 1);
  if (!nam_test_edge(nam, 0, 1)) {
    puts("removed edge from 0 to 1");
  }
  n = nam_size(nam);
  puts("\nlist of all edges");
  for (i = 0; i < n; ++i) {
    for (j = 0; j < n; ++j) {
      if (nam_test_edge(nam, i, j)) {
        printf("%d -> %d\n", i, j);
      }
    }
  }
  nam_destroy(nam, 1);
  return 0;
}
```