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

```asm
<main>:
  endbr64
  push   %r15
  lea    D1(%rip),%rsi
  lea    D39(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x128,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x118(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%r13
  lea    0x90(%rsp),%r15
  call   <fopen@plt>
  lea    D42(%rip),%rsi
  lea    D14(%rip),%rdi
  mov    %rax,%rbp
  call   <fopen@plt>
  lea    D3(%rip),%rsi
  lea    0xc(%rsp),%rdx
  mov    %rbp,%rdi
  mov    %rax,%r14
  xor    %eax,%eax
  call   <fscanf@plt>
  mov    0xc(%rsp),%esi
  test   %esi,%esi
  jle    L36
  xor    %ebx,%ebx
  lea    0x10(%rsp),%r13
  lea    D61(%rip),%r12
  nopl   (%rax)
L71:
  lea    (%rbx,%rbx,4),%rax
  mov    %r12,%rsi
  mov    %rbp,%rdi
  lea    (%rbx,%rax,2),%rdx
  xor    %eax,%eax
  add    $0x1,%rbx
  add    %r13,%rdx
  call   <fscanf@plt>
  mov    0xc(%rsp),%esi
  cmp    %ebx,%esi
  jg     L71
  test   %esi,%esi
  jle    L145
  xor    %ebx,%ebx
  lea    0x90(%rsp),%r15
  cs nopw 0x0(%rax,%rax,1)
L12:
  lea    (%rbx,%rbx,4),%rax
  mov    %r12,%rsi
  mov    %rbp,%rdi
  lea    (%rbx,%rax,2),%rdx
  xor    %eax,%eax
  add    $0x1,%rbx
  add    %r15,%rdx
  call   <fscanf@plt>
  mov    0xc(%rsp),%esi
  cmp    %ebx,%esi
  jg     L12
L36:
  mov    %r13,%rdi
  mov    $0x1,%ebx
  lea    D15(%rip),%r12
  call   <mat_copier@plt>
  mov    %rax,%rbp
  nopl   0x0(%rax,%rax,1)
L128:
  mov    0xc(%rsp),%esi
  mov    %rbp,%rdi
  call   <ninety_degree_conv@plt>
  mov    0xc(%rsp),%edx
  mov    %r15,%rsi
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <checker@plt>
  test   %eax,%eax
  jne    L5
L114:
  cmp    $0x3,%ebx
  je     L27
  add    $0x1,%ebx
  cmp    $0x7,%ebx
  jne    L128
  mov    0xc(%rsp),%esi
  mov    %rbp,%rdi
  call   <reflection_finder@plt>
  mov    0xc(%rsp),%edx
  mov    %r15,%rsi
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <checker@plt>
  test   %eax,%eax
  jne    L158
L38:
  mov    $0x3,%ebx
L130:
  mov    0xc(%rsp),%esi
  mov    %rbp,%rdi
  call   <ninety_degree_conv@plt>
  mov    0xc(%rsp),%edx
  mov    %r15,%rsi
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <checker@plt>
  test   %eax,%eax
  jne    L20
L90:
  sub    $0x1,%ebx
  jne    L130
  mov    %r14,%rdi
  mov    $0x7,%edx
  mov    %r12,%rsi
  call   <fprintf@plt>
  xor    %edi,%edi
  call   <exit@plt>
  mov    0x118(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L155
  add    $0x128,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L27:
  mov    $0x6,%ebx
  jmp    L128
  nopw   0x0(%rax,%rax,1)
L5:
  mov    %r14,%rdi
  mov    %ebx,%edx
  mov    %r12,%rsi
  call   <fprintf@plt>
  xor    %edi,%edi
  call   <exit@plt>
  jmp    L114
  nopl   0x0(%rax)
L20:
  mov    %r14,%rdi
  mov    $0x5,%edx
  mov    %r12,%rsi
  call   <fprintf@plt>
  xor    %edi,%edi
  call   <exit@plt>
  jmp    L90
L158:
  mov    %r14,%rdi
  mov    $0x4,%edx
  mov    %r12,%rsi
  call   <fprintf@plt>
  xor    %edi,%edi
  call   <exit@plt>
  jmp    L38
L145:
  lea    0x90(%rsp),%r15
  jmp    L36
L155:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D1
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D39
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D42
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D14
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D3
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D61
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D15
type_guessed: string

tool: D1: r

tool: D39: transform.in

tool: D42: w

tool: D14: transform.out

tool: D3: %d

tool: D61: %s

tool: D15: %d


assistant: ```c
main() {
  FILE *fin = fopen("transform.in", "r");
  FILE *fout = fopen("transform.out", "w");
  int n, i, j, no, flag = 0;
  char grid_Before[11][11], grid_After[11][11];
  char **p;
  fscanf(fin, "%d", &n);
  for (i = 0; i < n; ++i) {
    fscanf(fin, "%s", grid_Before[i]);
  }
  for (i = 0; i < n; ++i) {
    fscanf(fin, "%s", grid_After[i]);
  }
  p = mat_copier(grid_Before, n);
  for (i = 1; i < 7; ++i) {
    p = ninety_degree_conv(p, n);
    no = checker(p, grid_After, n);
    if (no) {
      fprintf(fout, "%d\n", i);
      exit(0);
    }
    if (i == 3)
      i += 2;
  }
  p = reflection_finder(p, n);
  no = checker(p, grid_After, n);
  if (no) {
    fprintf(fout, "%d\n", 4);
    exit(0);
  }
  for (i = 1; i < 4; ++i) {
    p = ninety_degree_conv(p, n);
    no = checker(p, grid_After, n);
    if (no) {
      fprintf(fout, "%d\n", 5);
      exit(0);
    }
  }
  fprintf(fout, "%d\n", 7);
  exit(0);
}
```