user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r15
  lea    D49(%rip),%rsi
  lea    D61(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x138,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x128(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  lea    D78(%rip),%rsi
  lea    D0(%rip),%rdi
  mov    %rax,%r13
  call   <fopen@plt>
  lea    0x70(%rsp),%rdi
  xor    %edx,%edx
  pxor   %xmm0,%xmm0
  mov    %rax,0x18(%rsp)
  mov    $0x14,%ecx
  xor    %eax,%eax
  lea    D38(%rip),%rsi
  mov    %rdi,0x8(%rsp)
  rep stos %rax,%es:(%rdi)
  movaps %xmm0,0x40(%rsp)
  mov    %dx,0x125(%rsp)
  lea    0x34(%rsp),%rdx
  movq   $0x0,0x119(%rsp)
  movl   $0x0,0x121(%rsp)
  movb   $0x0,0x127(%rsp)
  movq   $0x0,0x60(%rsp)
  movl   $0x0,(%rdi)
  movb   $0x0,0x4(%rdi)
  mov    %r13,%rdi
  movl   $0x0,0x68(%rsp)
  movaps %xmm0,0x50(%rsp)
  call   <fscanf@plt>
  mov    0x34(%rsp),%ecx
  test   %ecx,%ecx
  jle    L26
  xor    %ebx,%ebx
  lea    D24(%rip),%r15
  nopl   (%rax)
L85:
  mov    %rbx,%rdx
  mov    %r15,%rsi
  mov    %r13,%rdi
  xor    %eax,%eax
  shl    $0x4,%rdx
  sub    %rbx,%rdx
  add    0x8(%rsp),%rdx
  add    $0x1,%rbx
  call   <fscanf@plt>
  mov    0x34(%rsp),%eax
  cmp    %ebx,%eax
  jg     L85
  test   %eax,%eax
  jle    L26
  lea    0x3c(%rsp),%rax
  movl   $0x0,0x14(%rsp)
  lea    0x119(%rsp),%rbp
  mov    %rax,0x28(%rsp)
  lea    0x38(%rsp),%rax
  mov    %rax,0x20(%rsp)
  nopl   0x0(%rax)
L25:
  mov    %rbp,%rdx
  mov    %r15,%rsi
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <fscanf@plt>
  xor    %ebx,%ebx
  mov    0x8(%rsp),%r12
  jmp    L90
  nopl   0x0(%rax)
L14:
  add    $0x1,%ebx
L90:
  mov    %r12,%rdi
  mov    %rbp,%rsi
  add    $0xf,%r12
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L14
  mov    0x28(%rsp),%rcx
  mov    0x20(%rsp),%rdx
  lea    D56(%rip),%rsi
  mov    %r13,%rdi
  call   <fscanf@plt>
  mov    0x3c(%rsp),%ecx
  test   %ecx,%ecx
  je     L91
  mov    0x38(%rsp),%eax
  movslq %ebx,%rbx
  cltd
  idiv   %ecx
  mov    %eax,0x10(%rsp)
  imul   %ecx,%eax
  sub    %eax,0x40(%rsp,%rbx,4)
  test   %ecx,%ecx
  jle    L91
  xor    %r12d,%r12d
  nopl   0x0(%rax)
L92:
  mov    %rbp,%rdx
  mov    %r15,%rsi
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <fscanf@plt>
  xor    %ebx,%ebx
  mov    0x8(%rsp),%r14
  jmp    L113
  nopl   0x0(%rax)
L31:
  add    $0x1,%ebx
L113:
  mov    %r14,%rdi
  mov    %rbp,%rsi
  add    $0xf,%r14
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L31
  movslq %ebx,%rbx
  mov    0x10(%rsp),%eax
  add    $0x1,%r12d
  add    %eax,0x40(%rsp,%rbx,4)
  cmp    %r12d,0x3c(%rsp)
  jg     L92
L91:
  addl   $0x1,0x14(%rsp)
  mov    0x34(%rsp),%eax
  mov    0x14(%rsp),%ecx
  cmp    %ecx,%eax
  jg     L25
  test   %eax,%eax
  jle    L26
  xor    %ebx,%ebx
  lea    0x40(%rsp),%r12
  lea    D64(%rip),%rbp
  nopl   0x0(%rax)
L57:
  mov    %rbx,%rdx
  mov    (%r12,%rbx,4),%ecx
  mov    0x18(%rsp),%rdi
  mov    %rbp,%rsi
  shl    $0x4,%rdx
  sub    %rbx,%rdx
  add    0x8(%rsp),%rdx
  add    $0x1,%rbx
  call   <fprintf@plt>
  cmp    %ebx,0x34(%rsp)
  jg     L57
L26:
  mov    %r13,%rdi
  call   <fclose@plt>
  mov    0x18(%rsp),%rdi
  call   <fclose@plt>
  mov    0x128(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L16
  add    $0x138,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L16:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D49
type_guessed: string
name: disassemble_data
arguments: data_tag: D61
type_guessed: string
name: disassemble_data
arguments: data_tag: D78
type_guessed: string
name: disassemble_data
arguments: data_tag: D0
type_guessed: string
name: disassemble_data
arguments: data_tag: D38
type_guessed: string
name: disassemble_data
arguments: data_tag: D24
type_guessed: string
name: disassemble_data
arguments: data_tag: D56
type_guessed: string
name: disassemble_data
arguments: data_tag: D64
type_guessed: string

tool: D49: r

tool: D61: gift1.in

tool: D78: w

tool: D0: gift1.out

tool: D38: %d

tool: D24: %s

tool: D56: %d %d

tool: D64: %s %d


assistant: ```c
int main(void) {
  FILE *fin = fopen("gift1.in", "r");
  FILE *fout = fopen("gift1.out", "w");
  char person_name[11][15] = {0};
  char temp_name[15] = {0};
  int i;
  int j;
  int k;
  int NP;
  int average_money;
  int money_give;
  int number_give;
  int total_money[11] = {0};
  fscanf(fin, "%d", &NP);
  for (i = 0; i < NP; ++i) {
    fscanf(fin, "%s", person_name[i]);
  }
  for (i = 0; i < NP; ++i) {
    j = 0;
    fscanf(fin, "%s", temp_name);
    while (strcmp(person_name[j], temp_name)) {
      ++j;
    }
    fscanf(fin, "%d %d", &money_give, &number_give);
    if (0 == number_give) {
      average_money = 0;
    } else {
      average_money = money_give / number_give;
    }
    total_money[j] -= average_money * number_give;
    for (k = 0; k < number_give; ++k) {
      j = 0;
      fscanf(fin, "%s", temp_name);
      while (strcmp(person_name[j], temp_name)) {
        ++j;
      }
      total_money[j] += average_money;
    }
  }
  for (i = 0; i < NP; ++i) {
    fprintf(fout, "%s %d\n", person_name[i], total_money[i]);
  }
  fclose(fin);
  fclose(fout);
  return 0;
}
```