user: Converte this assembly snippet into its equivalent C code:

```asm
<print_lattice>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x3c(%rbp)
  mov    %r8d,-0x40(%rbp)
  mov    %r9,-0x48(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0x50(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x14(%rbp)
  jmp    L43
L185:
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x14(%rbp)
L43:
  mov    -0x14(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L185
  lea    D97(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D89(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x14(%rbp)
  jmp    L162
L21:
  lea    D87(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x14(%rbp)
L162:
  mov    -0x14(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L21
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x18(%rbp)
  jmp    L109
L95:
  lea    D89(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x14(%rbp)
  jmp    L45
L205:
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L74
  mov    -0xc(%rbp),%edx
  mov    -0x48(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L74
  mov    $0x41,%edi
  call   <putchar@plt>
  jmp    L172
L74:
  mov    -0x10(%rbp),%edx
  mov    -0x50(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L188
  mov    -0xc(%rbp),%edx
  mov    -0x50(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L188
  mov    $0x42,%edi
  call   <putchar@plt>
  jmp    L172
L188:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <putchar@plt>
L172:
  mov    -0x14(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jge    L5
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L36
  lea    D107(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L5
L36:
  lea    D98(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L5:
  addl   $0x1,-0x14(%rbp)
L45:
  mov    -0x14(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L205
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x18(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jge    L70
  lea    D89(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x14(%rbp)
  jmp    L154
L7:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L33
  mov    $0x7c,%edi
  call   <putchar@plt>
  jmp    L147
L33:
  mov    $0x20,%edi
  call   <putchar@plt>
L147:
  mov    -0x14(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jge    L183
  lea    D98(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L183:
  addl   $0x1,-0x14(%rbp)
L154:
  mov    -0x14(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L7
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L70:
  addl   $0x1,-0x18(%rbp)
L109:
  mov    -0x18(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L95
  movl   $0x0,-0x14(%rbp)
  jmp    L151
L150:
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x14(%rbp)
L151:
  mov    -0x14(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L150
  lea    D97(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L14
  call   <__stack_chk_fail@plt>
L14:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D47
type_infered: string
name: parse_data
arguments: data_tag: D97
type_infered: string
name: parse_data
arguments: data_tag: D89
type_infered: string
name: parse_data
arguments: data_tag: D87
type_infered: string
name: parse_data
arguments: data_tag: D17
type_infered: string
name: parse_data
arguments: data_tag: D107
type_infered: string
name: parse_data
arguments: data_tag: D98
type_infered: string

tool: D47: oooo

tool: D97: ooo

tool: D89: o 

tool: D87:     

tool: D17: o

tool: D107:  - 

tool: D98:    

assistant: ```c
void print_lattice(int **site_marks, int **vbonds, int **hbonds, int M, int N, int A1[2], int A2[2]) {
  int i, j;
  int ij[2];
  for (j = 0; j < N; j++)
    printf("oooo");
  printf("ooo\n");
  printf("o ");
  for (j = 0; j < N; j++)
    printf("    ");
  printf("o\n");
  for (i = 0; i < M; i++) {
    printf("o ");
    for (j = 0; j < N; j++) {
      ij[0] = i;
      ij[1] = j;
      if ((((ij)[0] == (A1)[0]) && ((ij)[1] == (A1)[1])))
        printf("A");
      else if ((((ij)[0] == (A2)[0]) && ((ij)[1] == (A2)[1])))
        printf("B");
      else
        printf("%c", site_marks[i][j]);
      if (j < N) {
        if (hbonds[i][j])
          printf(" - ");
        else
          printf("   ");
      }
    }
    printf("o\n");
    if (i < M) {
      printf("o ");
      for (j = 0; j < N; j++) {
        if (vbonds[i][j])
          printf("|");
        else
          printf(" ");
        if (j < N)
          printf("   ");
      }
      printf("o\n");
    }
  }
  for (j = 0; j < N; j++)
    printf("oooo");
  printf("ooo\n");
}
```