user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x58(%rbp)
  jmp    L27
L132:
  lea    -0x50(%rbp),%rdx
  mov    -0x58(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  addl   $0x1,-0x58(%rbp)
L27:
  cmpl   $0x7,-0x58(%rbp)
  jle    L132
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x58(%rbp)
  jmp    L113
L41:
  movl   $0x0,-0x54(%rbp)
  jmp    L42
L97:
  mov    $0x7,%eax
  sub    -0x54(%rbp),%eax
  mov    -0x58(%rbp),%edx
  movslq %edx,%rdx
  cltq
  shl    $0x3,%rax
  add    %rbp,%rax
  add    %rdx,%rax
  sub    $0x50,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <putchar@plt>
  addl   $0x1,-0x54(%rbp)
L42:
  cmpl   $0x7,-0x54(%rbp)
  jle    L97
  mov    $0xa,%edi
  call   <putchar@plt>
  addl   $0x1,-0x58(%rbp)
L113:
  cmpl   $0x7,-0x58(%rbp)
  jle    L41
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x58(%rbp)
  jmp    L115
L108:
  movl   $0x0,-0x54(%rbp)
  jmp    L131
L45:
  mov    $0x7,%eax
  sub    -0x58(%rbp),%eax
  mov    $0x7,%edx
  sub    -0x54(%rbp),%edx
  movslq %edx,%rdx
  cltq
  shl    $0x3,%rax
  add    %rbp,%rax
  add    %rdx,%rax
  sub    $0x50,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <putchar@plt>
  addl   $0x1,-0x54(%rbp)
L131:
  cmpl   $0x7,-0x54(%rbp)
  jle    L45
  mov    $0xa,%edi
  call   <putchar@plt>
  addl   $0x1,-0x58(%rbp)
L115:
  cmpl   $0x7,-0x58(%rbp)
  jle    L108
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x58(%rbp)
  jmp    L87
L6:
  movl   $0x0,-0x54(%rbp)
  jmp    L139
L127:
  mov    $0x7,%eax
  sub    -0x58(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x54(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rbp,%rax
  add    %rdx,%rax
  sub    $0x50,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <putchar@plt>
  addl   $0x1,-0x54(%rbp)
L139:
  cmpl   $0x7,-0x54(%rbp)
  jle    L127
  mov    $0xa,%edi
  call   <putchar@plt>
  addl   $0x1,-0x58(%rbp)
L87:
  cmpl   $0x7,-0x58(%rbp)
  jle    L6
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L54
  call   <__stack_chk_fail@plt>
L54:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D0
type_guessed: string
name: unpack_data
arguments: data_label: D1
type_guessed: string
name: unpack_data
arguments: data_label: D20
type_guessed: string
name: unpack_data
arguments: data_label: D3
type_guessed: string

tool: D0: %s


tool: D1: 90

tool: D20: 180

tool: D3: 270

assistant: ```c
int main(void) {
  int i, j;
  char board[8][8];
  for (i = 0; i < 8; i++)
    scanf("%s\n", board[i]);
  printf("90\n");
  for (i = 0; i < 8; i++) {
    for (j = 0; j < 8; j++)
      printf("%c", board[7 - j][i]);
    printf("\n");
  }
  printf("180\n");
  for (i = 0; i < 8; i++) {
    for (j = 0; j < 8; j++)
      printf("%c", board[7 - i][7 - j]);
    printf("\n");
  }
  printf("270\n");
  for (i = 0; i < 8; i++) {
    for (j = 0; j < 8; j++)
      printf("%c", board[j][7 - i]);
    printf("\n");
  }
  return 0;
}
```