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

```asm
<printGrid>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  lea    D58(%rip),%rax
  mov    %rax,%rdi
  call   <system@plt>
  movl   $0x0,-0x4(%rbp)
  jmp    L7
L69:
  movl   $0x0,-0x8(%rbp)
  jmp    L11
L31:
  mov    -0x4(%rbp),%edx
  movslq %edx,%rax
  imul   $0x55555556,%rax,%rax
  shr    $0x20,%rax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  mov    %eax,%ecx
  add    %ecx,%ecx
  add    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  test   %eax,%eax
  jne    L94
  mov    $0x2d,%edi
  call   <putchar@plt>
L94:
  addl   $0x1,-0x8(%rbp)
L11:
  cmpl   $0x18,-0x8(%rbp)
  jle    L31
  mov    $0xa,%edi
  call   <putchar@plt>
  movl   $0x0,-0x8(%rbp)
  jmp    L137
L96:
  mov    -0x8(%rbp),%edx
  movslq %edx,%rax
  imul   $0x55555556,%rax,%rax
  shr    $0x20,%rax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  mov    %eax,%ecx
  add    %ecx,%ecx
  add    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  test   %eax,%eax
  jne    L133
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L133:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  test   %eax,%eax
  jne    L34
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L2
L34:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  cmp    $0xa,%eax
  jne    L35
  lea    D51(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L2
L35:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  mov    %eax,%esi
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L2:
  addl   $0x1,-0x8(%rbp)
L137:
  cmpl   $0x8,-0x8(%rbp)
  jle    L96
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  addl   $0x1,-0x4(%rbp)
L7:
  cmpl   $0x8,-0x4(%rbp)
  jle    L69
  movl   $0x0,-0x8(%rbp)
  jmp    L45
L70:
  mov    $0x2d,%edi
  call   <putchar@plt>
  addl   $0x1,-0x8(%rbp)
L45:
  cmpl   $0x18,-0x8(%rbp)
  jle    L70
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D58
data_type: string
name: read_data
arguments: data_label: D24
data_type: string
name: read_data
arguments: data_label: D7
data_type: string
name: read_data
arguments: data_label: D51
data_type: string
name: read_data
arguments: data_label: D4
data_type: string
name: read_data
arguments: data_label: D15
data_type: string

tool: D58: cls

tool: D24: | 

tool: D7:   

tool: D51: X 

tool: D4: %d 

tool: D15: |

assistant: ```c
void printGrid(int grid[9][9]) {
  int x, y;
  system("cls");
  for (y = 0; y < 9; ++y) {
    for (x = 0; x < 25; ++x)
      if ((y % 3) == 0)
        printf("-");
    printf("\n");
    for (x = 0; x < 9; ++x) {
      if ((x % 3) == 0)
        printf("| ");
      if (grid[x][y] == 0)
        printf("  ");
      else if (grid[x][y] == 10)
        printf("X ");
      else
        printf("%d ", grid[x][y]);
    }
    printf("|\n");
  }
  for (x = 0; x < 25; ++x)
    printf("-");
  return;
}
```