user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D29(%rip),%rax
  mov    %rax,%rsi
  lea    D72(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x18(%rbp)
  movq   $0x0,-0x20(%rbp)
  lea    -0x28(%rbp),%rcx
  lea    -0x2c(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  lea    D79(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L5
L58:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%rax
  lea    D14(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  add    %rax,-0x20(%rbp)
  addl   $0x1,-0x24(%rbp)
L5:
  mov    -0x2c(%rbp),%eax
  cmp    %eax,-0x24(%rbp)
  jl     L58
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x28(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x20(%rbp),%rax
  cqto
  idiv   %rcx
  mov    %eax,-0x28(%rbp)
  movq   $0x0,-0x20(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L64
L25:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  add    %rax,-0x20(%rbp)
  mov    -0x28(%rbp),%eax
  cltq
  cmp    %rax,-0x20(%rbp)
  jne    L55
  movq   $0x0,-0x20(%rbp)
L55:
  addl   $0x1,-0x24(%rbp)
L64:
  mov    -0x2c(%rbp),%eax
  cmp    %eax,-0x24(%rbp)
  jl     L25
  lea    D9(%rip),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L39
  lea    D41(%rip),%rax
  jmp    L3
L39:
  lea    D31(%rip),%rax
L3:
  mov    -0x18(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fputs@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L40
  call   <__stack_chk_fail@plt>
L40:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D29
data_type: string
name: read_data
arguments: label: D72
data_type: string
name: read_data
arguments: label: D79
data_type: string
name: read_data
arguments: label: D14
data_type: string
name: read_data
arguments: label: D9
data_type: string
name: read_data
arguments: label: D37
data_type: string
name: read_data
arguments: label: D41
data_type: string
name: read_data
arguments: label: D31
data_type: string

tool: D29: r

tool: D72: INP.TXT

tool: D79: %d %d

tool: D14: %d

tool: D9: w

tool: D37: OUT.TXT

tool: D41: NO


tool: D31: YES


assistant: ```c
int main() {
  FILE *f = fopen("INP.TXT", "r");
  int n, k, *a, i;
  long long s = 0;
  fscanf(f, "%d %d", &n, &k);
  a = malloc(n * sizeof(int));
  for (i = 0; i < n; i++) {
    fscanf(f, "%d", a + i);
    s += a[i];
  }
  fclose(f);
  k = s / k;
  s = 0;
  for (i = 0; i < n; i++) {
    s += a[i];
    if (s == k)
      s = 0;
  }
  f = fopen("OUT.TXT", "w");
  fputs(s ? "NO\n" : "YES\n", f);
  fclose(f);
  return 0;
}
```