user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    -0x40(%rbp),%rsi
  lea    D19(%rip),%rdi
  call   <scanf@plt>
  mov    -0x40(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x40(%rbp)
  test   %eax,%eax
  je     L48
  lea    -0x3c(%rbp),%rax
  mov    %rax,-0x70(%rbp)
  lea    D19(%rip),%r15
  jmp    L109
L87:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L73
  orq    $0x0,-0x8(%rsp,%rdx,1)
L73:
  lea    0x3(%rsp),%rax
  mov    %rax,%rdi
  shr    $0x2,%rdi
  mov    %rdi,-0x68(%rbp)
  and    $0xfffffffffffffffc,%rax
  mov    %rax,-0x48(%rbp)
  test   %r8d,%r8d
  jle    L8
  mov    -0x58(%rbp),%rax
  shr    $0x2,%rax
  mov    %rax,-0x50(%rbp)
  mov    $0x0,%r14d
  mov    $0x0,%r13d
  jmp    L59
L161:
  mov    %r12,%rsi
  mov    %r15,%rdi
  call   <scanf@plt>
  add    $0x1,%ebx
  add    $0x4,%r12
  cmp    %r13d,%ebx
  jle    L161
L150:
  add    $0x1,%r13d
  mov    -0x3c(%rbp),%r8d
  add    -0x50(%rbp),%r14
  cmp    %r13d,%r8d
  jle    L8
L59:
  mov    -0x48(%rbp),%rax
  lea    (%rax,%r14,4),%r12
  mov    $0x0,%ebx
  test   %r13d,%r13d
  jns    L161
  jmp    L150
L8:
  mov    %r8d,%r9d
  sub    $0x1,%r9d
  js     L74
  mov    -0x58(%rbp),%r11
  mov    %r11,%rsi
  shr    $0x2,%rsi
  sub    $0x2,%r8d
  mov    -0x48(%rbp),%rbx
  lea    0x4(%rbx),%r10
  jmp    L175
L89:
  movslq %r8d,%rdx
  mov    %r11,%rax
  imul   %rdx,%rax
  add    %rbx,%rax
  imul   %rsi,%rdx
  mov    %r9d,%ecx
  add    %rcx,%rdx
  lea    (%r10,%rdx,4),%rdi
L104:
  mov    (%rax,%rsi,4),%edx
  mov    0x4(%rax,%rsi,4),%ecx
  cmp    %ecx,%edx
  cmovl  %ecx,%edx
  add    %edx,(%rax)
  add    $0x4,%rax
  cmp    %rdi,%rax
  jne    L104
L127:
  sub    $0x1,%r9d
  sub    $0x1,%r8d
  cmp    $0xffffffff,%r9d
  je     L74
L175:
  test   %r9d,%r9d
  jns    L89
  jmp    L127
L74:
  mov    -0x68(%rbp),%rax
  mov    0x0(,%rax,4),%esi
  lea    D9(%rip),%rdi
  call   <printf@plt>
  mov    -0x60(%rbp),%rsp
  mov    -0x40(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x40(%rbp)
  test   %eax,%eax
  je     L48
L109:
  mov    %rsp,-0x60(%rbp)
  mov    -0x70(%rbp),%rsi
  mov    %r15,%rdi
  call   <scanf@plt>
  mov    -0x3c(%rbp),%r8d
  movslq %r8d,%rax
  lea    0x0(,%rax,4),%rdi
  mov    %rdi,-0x58(%rbp)
  imul   %rax,%rax
  lea    0xf(,%rax,4),%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  shl    $0x4,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L62:
  cmp    %rdx,%rsp
  je     L87
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L62
L48:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L163
  mov    $0x0,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L163:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D19
datatype: string
name: read_data
arguments: data_tag: D9
datatype: string

tool: D19: %d

tool: D9: %d


assistant: ```c
int main(void) {
  int T, N, i, j, max_path = 0;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &N);
    int arr[N][N];
    i = 0;
    for (i = 0; i < N; i++) {
      for (j = 0; j <= i; j++) {
        scanf("%d", &arr[i][j]);
      }
    }
    for (i = N - 1; i >= 0; i--) {
      for (j = 0; j <= i; j++) {
        arr[i - 1][j] += arr[i][j] >= arr[i][j + 1] ? arr[i][j] : arr[i][j + 1];
      }
    }
    printf("%d\n", arr[0][0]);
  }
  return 0;
}
```