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

```asm
<main>:
  endbr64
  push   %rbp
  lea    D3(%rip),%rdi
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  lea    -0x40(%rbp),%rsi
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <scanf@plt>
  movslq -0x40(%rbp),%rax
  mov    %rsp,%rsi
  mov    %rax,%rcx
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rsi
  and    $0xfffffffffffffff0,%rdx
  cmp    %rsi,%rsp
  je     L77
L35:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rsi,%rsp
  jne    L35
L77:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L70
L87:
  mov    %rsp,%r12
  test   %ecx,%ecx
  jle    L8
  mov    %r12,%r13
  xor    %ebx,%ebx
  lea    D46(%rip),%r14
  nopl   (%rax)
L159:
  mov    %r13,%rsi
  mov    %r14,%rdi
  add    $0x1,%ebx
  add    $0x4,%r13
  call   <scanf@plt>
  cmp    %ebx,-0x40(%rbp)
  jg     L159
L8:
  lea    -0x3c(%rbp),%rsi
  lea    D55(%rip),%rdi
  call   <scanf@plt>
  movslq -0x3c(%rbp),%rax
  mov    %rsp,%rcx
  mov    %rax,%r8
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L123
L129:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L129
L123:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L47
L197:
  lea    0x3(%rsp),%rcx
  mov    %rcx,%rax
  and    $0xfffffffffffffffc,%rcx
  shr    $0x2,%rax
  mov    %rcx,%rbx
  mov    %rax,-0x48(%rbp)
  test   %r8d,%r8d
  jle    L7
  mov    %rcx,%r15
  xor    %r13d,%r13d
  lea    D46(%rip),%r14
  cs nopw 0x0(%rax,%rax,1)
L98:
  mov    %r15,%rsi
  mov    %r14,%rdi
  add    $0x1,%r13d
  add    $0x4,%r15
  call   <scanf@plt>
  mov    -0x3c(%rbp),%r8d
  cmp    %r13d,%r8d
  jg     L98
L7:
  mov    -0x40(%rbp),%eax
  test   %eax,%eax
  jle    L86
  mov    -0x48(%rbp),%rcx
  lea    -0x1(%rax),%esi
  lea    0x1(%rax),%r9d
  mov    $0x1,%edx
  mov    $0x1,%edi
  mov    0x0(,%rcx,4),%r10d
  mov    %rbx,%rcx
  jmp    L234
  nopl   (%rax)
L132:
  add    $0x1,%rdx
  sub    $0x1,%esi
  sub    $0x2,%rcx
  cmp    %r9,%rdx
  je     L58
L234:
  cmp    -0x4(%r12,%rdx,4),%r10d
  jne    L132
  cmp    %edx,%esi
  jle    L132
  mov    %rdx,%rax
  jmp    L177
  nopl   0x0(%rax,%rax,1)
L62:
  add    $0x2,%rax
  add    $0x1,%edi
  cmp    %eax,%esi
  jle    L132
L177:
  mov    (%r12,%rax,4),%ebx
  cmp    %ebx,0x2(%rcx,%rax,2)
  je     L62
  jmp    L132
L86:
  mov    $0x1,%edi
  nopl   0x0(%rax)
L58:
  cmp    %edi,%r8d
  je     L206
  lea    D38(%rip),%rdi
  call   <printf@plt>
L31:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L182
  lea    -0x28(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L206:
  lea    D30(%rip),%rdi
  call   <printf@plt>
  jmp    L31
L47:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L197
L70:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L87
L182:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D3
data_type: string
name: read_data
arguments: data_label: D46
data_type: string
name: read_data
arguments: data_label: D55
data_type: string
name: read_data
arguments: data_label: D38
data_type: string
name: read_data
arguments: data_label: D30
data_type: string

tool: D3: %d


tool: D46: %d 

tool: D55: 
%d


tool: D38: NO

tool: D30: YES

assistant: ```c
int main() {
  int N1, N2, i, j, cnt = 1;
  scanf("%d\n", &N1);
  int A1[N1];
  for (i = 0; i < N1; i++)
    scanf("%d ", &A1[i]);
  scanf("\n%d\n", &N2);
  int A2[N2];
  for (j = 0; j < N2; j++)
    scanf("%d ", &A2[j]);
  for (int k = 0; k < N1; k++) {
    if (A2[0] == A1[k]) {
      int s = 1;
      for (int m = k + 1; m < N1 - k - 1; m++) {
        if (A2[s++] == A1[m++])
          cnt = cnt + 1;
        else
          break;
      }
    }
  }
  if (cnt == N2)
    printf("YES");
  else
    printf("NO");
  return 0;
}
```