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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    D12(%rip),%rdi
  call   <printf@plt>
  lea    -0x50(%rbp),%rdx
  lea    -0x58(%rbp),%rsi
  lea    D21(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x50(%rbp),%rax
  mov    %rax,-0x68(%rbp)
  mov    -0x58(%rbp),%rdx
  imul   %rdx,%rax
  add    $0xf,%rax
  mov    %rax,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rcx
  sub    %rax,%rcx
L1:
  cmp    %rcx,%rsp
  je     L71
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L1
L71:
  mov    %rsi,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L13
  orq    $0x0,-0x8(%rsp,%rax,1)
L13:
  mov    %rsp,%r14
  test   %rdx,%rdx
  je     L31
  mov    %r14,%r12
  mov    $0x0,%r15d
  lea    D30(%rip),%r13
  jmp    L85
L100:
  lea    (%r12,%rbx,1),%rsi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  add    $0x1,%rbx
  cmp    %rbx,-0x50(%rbp)
  ja     L100
L37:
  add    $0x1,%r15
  add    -0x68(%rbp),%r12
  cmp    %r15,-0x58(%rbp)
  jbe    L31
L85:
  mov    $0x0,%ebx
  cmpq   $0x0,-0x50(%rbp)
  jne    L100
  jmp    L37
L31:
  lea    D37(%rip),%rdi
  call   <printf@plt>
  lea    -0x59(%rbp),%r12
  lea    D66(%rip),%rbx
  lea    D65(%rip),%r15
  lea    D50(%rip),%r13
  jmp    L72
L52:
  mov    %r15,%rdi
  call   <printf@plt>
  mov    %r14,%rdx
  mov    -0x50(%rbp),%rsi
  mov    -0x58(%rbp),%rdi
  call   <print_screen@plt>
  mov    %r13,%rdi
  call   <printf@plt>
  movsbl -0x59(%rbp),%r9d
  mov    -0x40(%rbp),%r8
  mov    -0x48(%rbp),%rcx
  mov    %r14,%rdx
  mov    -0x50(%rbp),%rsi
  mov    -0x58(%rbp),%rdi
  call   <paint_fill@plt>
  mov    %r14,%rdx
  mov    -0x50(%rbp),%rsi
  mov    -0x58(%rbp),%rdi
  call   <print_screen@plt>
L72:
  lea    -0x40(%rbp),%rdx
  lea    -0x48(%rbp),%rsi
  mov    %r12,%rcx
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  cmp    $0x3,%eax
  je     L52
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L19
  mov    $0x0,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L19:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D12
type: string
name: extract_symbolic_data
arguments: tag: D21
type: string
name: extract_symbolic_data
arguments: tag: D30
type: string
name: extract_symbolic_data
arguments: tag: D37
type: string
name: extract_symbolic_data
arguments: tag: D66
type: string
name: extract_symbolic_data
arguments: tag: D65
type: string
name: extract_symbolic_data
arguments: tag: D50
type: string

tool: D12: Enter screen size (X x Y), an each cell's color.


tool: D21: %zu%zu

tool: D30:  %c

tool: D37: Now enter your queries. The query format is: X Y C, where X and Y indicate the target cell, and C the new color.


tool: D66: %zu%zu %c

tool: D65: Before:


tool: D50: After:


assistant: ```c
int main(void) {
  printf("Enter screen size (X x Y), an each cell's color.\n");
  size_t x, y;
  scanf("%zu%zu", &x, &y);
  char screen[x][y];
  size_t i;
  for (i = 0; i < x; i++) {
    size_t j;
    for (j = 0; j < y; j++) {
      scanf(" %c", &screen[i][j]);
    }
  }
  printf("Now enter your queries. The query format is: X Y C, "
         "where X and Y indicate the target cell, and C the new color.\n");
  size_t px, py;
  char new_color;
  while (scanf("%zu%zu %c", &px, &py, &new_color) == 3) {
    printf("Before:\n");
    print_screen(x, y, screen);
    printf("After:\n");
    paint_fill(x, y, screen, px, py, new_color);
    print_screen(x, y, screen);
  }
  return 0;
}
```