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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x40(%rbp),%rdx
  lea    -0x44(%rbp),%rax
  mov    %rax,%rsi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x44(%rbp),%eax
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x44(%rbp),%eax
  lea    0x0(,%rax,8),%edx
  mov    -0x18(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x44(%rbp),%eax
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x44(%rbp),%eax
  lea    0x0(,%rax,8),%edx
  mov    -0x10(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0x0,-0x30(%rbp)
  jmp    L4
L38:
  lea    -0x34(%rbp),%rcx
  lea    -0x38(%rbp),%rdx
  lea    -0x3c(%rbp),%rax
  mov    %rax,%rsi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x3c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x34(%rbp),%eax
  mov    %eax,%esi
  mov    -0x3c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  add    %rsi,%rdx
  mov    %rdx,(%rax)
  mov    -0x38(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x34(%rbp),%eax
  mov    %eax,%esi
  mov    -0x38(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,8),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  add    %rsi,%rdx
  mov    %rdx,(%rax)
  addl   $0x1,-0x30(%rbp)
L4:
  mov    -0x40(%rbp),%eax
  cmp    %eax,-0x30(%rbp)
  jb     L38
  movq   $0x0,-0x28(%rbp)
  movq   $0x0,-0x20(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L40
L48:
  mov    -0x2c(%rbp),%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L70
  mov    -0x2c(%rbp),%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    %rax,-0x20(%rbp)
L70:
  mov    -0x2c(%rbp),%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L60
  mov    -0x20(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jbe    L24
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x28(%rbp)
L24:
  mov    -0x2c(%rbp),%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  sub    %rax,-0x20(%rbp)
L60:
  addl   $0x1,-0x2c(%rbp)
L40:
  mov    -0x44(%rbp),%eax
  cmp    %eax,-0x2c(%rbp)
  jb     L48
  mov    -0x28(%rbp),%rax
  mov    %rax,%rsi
  lea    D22(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L6
  call   <__stack_chk_fail@plt>
L6:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D6
type_guessed: string
name: disassemble_data
arguments: data_tag: D3
type_guessed: string
name: disassemble_data
arguments: data_tag: D22
type_guessed: string

tool: D6: %u %u

tool: D3: %u %u %u

tool: D22: %llu


assistant: ```c
int main() {
  unsigned int n;
  unsigned int m;
  scanf("%u %u", &n, &m);
  long long *array;
  array = malloc(n * sizeof(long long));
  memset(array, 0, n * sizeof(long long));
  long long *brray;
  brray = malloc(n * sizeof(long long));
  memset(brray, 0, n * sizeof(long long));
  for (unsigned int i = 0; i < m; i++) {
    unsigned int a, b, k;
    scanf("%u %u %u", &a, &b, &k);
    array[a - 1] += k;
    brray[b - 1] += k;
  }
  unsigned long long max = 0, tmp = 0;
  for (unsigned int i = 0; i < n; i++) {
    if (array[i]) {
      tmp += array[i];
    }
    if (brray[i]) {
      if (tmp > max) {
        max = tmp;
      }
      tmp -= brray[i];
    }
  }
  printf("%llu\n", max);
  free(array);
  return 0;
}
```