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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    -0x40(%rbp),%rdx
  lea    -0x44(%rbp),%rsi
  lea    D39(%rip),%rdi
  call   <scanf@plt>
  mov    -0x44(%rbp),%eax
  movslq -0x40(%rbp),%rcx
  lea    0x0(,%rcx,8),%rbx
  mov    %rbx,-0x58(%rbp)
  movslq %eax,%rdx
  imul   %rcx,%rdx
  shl    $0x3,%rdx
  lea    0xf(%rdx),%rsi
  mov    %rsi,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rsi
  mov    %rsp,%rdi
  sub    %rsi,%rdi
L184:
  cmp    %rdi,%rsp
  je     L148
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L184
L148:
  mov    %rcx,%rsi
  and    $0xfff,%esi
  sub    %rsi,%rsp
  test   %rsi,%rsi
  je     L437
  orq    $0x0,-0x8(%rsp,%rsi,1)
L437:
  mov    %rsp,-0x60(%rbp)
  lea    0xf(%rdx),%rsi
  mov    %rsi,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rsi
  mov    %rsp,%rdi
  sub    %rsi,%rdi
L469:
  cmp    %rdi,%rsp
  je     L73
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L469
L73:
  mov    %rcx,%rsi
  and    $0xfff,%esi
  sub    %rsi,%rsp
  test   %rsi,%rsi
  je     L115
  orq    $0x0,-0x8(%rsp,%rsi,1)
L115:
  mov    %rsp,-0x80(%rbp)
  add    $0xf,%rdx
  mov    %rdx,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rsi
  sub    %rdx,%rsi
L461:
  cmp    %rsi,%rsp
  je     L282
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L461
L282:
  mov    %rcx,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L207
  orq    $0x0,-0x8(%rsp,%rdx,1)
L207:
  mov    %rsp,-0x68(%rbp)
  test   %eax,%eax
  jle    L29
  mov    -0x58(%rbp),%rax
  shr    $0x3,%rax
  mov    %rax,-0x70(%rbp)
  mov    $0x0,%r15d
  mov    $0x0,%r14d
  lea    D29(%rip),%r13
  jmp    L27
L60:
  mov    %r12,%rsi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  add    $0x1,%ebx
  add    $0x8,%r12
  cmp    %ebx,-0x40(%rbp)
  jg     L60
L203:
  add    $0x1,%r14d
  mov    -0x44(%rbp),%eax
  add    -0x70(%rbp),%r15
  cmp    %r14d,%eax
  jle    L29
L27:
  mov    -0x68(%rbp),%rax
  lea    (%rax,%r15,8),%r12
  mov    $0x0,%ebx
  cmpl   $0x0,-0x40(%rbp)
  jg     L60
  jmp    L203
L29:
  movslq -0x40(%rbp),%rdx
  lea    0x0(,%rdx,4),%rbx
  mov    %rbx,-0x78(%rbp)
  cltq
  imul   %rbx,%rax
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffffff0,%rdx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rcx
  sub    %rax,%rcx
L153:
  cmp    %rcx,%rsp
  je     L396
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L153
L396:
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L250
  orq    $0x0,-0x8(%rsp,%rax,1)
L250:
  mov    %rsp,%r13
  mov    %r13,-0x70(%rbp)
  cmpl   $0x0,-0x44(%rbp)
  jle    L1
  mov    %r13,%r14
  mov    $0x0,%r15d
  lea    D17(%rip),%r12
  jmp    L331
L231:
  movl   $0x0,(%r14,%rbx,4)
L254:
  add    $0x1,%rbx
  cmp    %ebx,-0x40(%rbp)
  jle    L168
L377:
  lea    -0x3c(%rbp),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  cmpl   $0x0,-0x3c(%rbp)
  je     L231
  movl   $0x1,0x0(%r13,%rbx,4)
  jmp    L254
L168:
  add    $0x1,%r15d
  mov    -0x44(%rbp),%eax
  mov    -0x78(%rbp),%rbx
  add    %rbx,%r13
  add    %rbx,%r14
  cmp    %r15d,%eax
  jle    L179
L331:
  mov    $0x0,%ebx
  cmpl   $0x0,-0x40(%rbp)
  jg     L377
  jmp    L168
L179:
  test   %eax,%eax
  jle    L1
  mov    -0x70(%rbp),%r13
  mov    -0x80(%rbp),%r12
  mov    $0x0,%r14d
  mov    -0x78(%rbp),%r15
  jmp    L114
L83:
  add    $0x1,%rax
  cmp    %rdi,%rax
  je     L417
L65:
  cmpl   $0x0,(%rsi,%rax,4)
  je     L83
  mov    (%r8,%rax,8),%rcx
  cmp    %rcx,%rdx
  cmovl  %rcx,%rdx
  jmp    L83
L417:
  add    $0x1,%r9d
  add    -0x58(%rbp),%r8
  add    %r15,%rsi
  cmp    %r10d,%r9d
  je     L482
L76:
  mov    $0x0,%eax
  test   %r11d,%r11d
  jg     L65
  jmp    L417
L286:
  mov    $0xffffffffffffffff,%rdx
L482:
  mov    %rdx,(%r12,%rbx,8)
  mov    -0x40(%rbp),%ecx
  add    $0x1,%rbx
  cmp    %ebx,%ecx
  jle    L107
L4:
  mov    %ebx,%esi
  mov    $0xffffffffffffffff,%rdx
  cmpl   $0x0,0x0(%r13,%rbx,4)
  je     L482
  mov    -0x60(%rbp),%r9
  mov    -0x68(%rbp),%r8
  mov    -0x44(%rbp),%edx
  mov    %r14d,%edi
  call   <djikstras@plt>
  mov    -0x44(%rbp),%r10d
  test   %r10d,%r10d
  jle    L286
  mov    -0x40(%rbp),%r11d
  mov    -0x60(%rbp),%r8
  mov    -0x70(%rbp),%rsi
  mov    $0xffffffffffffffff,%rdx
  mov    $0x0,%r9d
  mov    %r11d,%edi
  jmp    L76
L107:
  add    $0x1,%r14d
  mov    -0x44(%rbp),%r9d
  add    -0x58(%rbp),%r12
  add    %r15,%r13
  cmp    %r14d,%r9d
  jle    L136
L114:
  mov    -0x40(%rbp),%ecx
  mov    $0x0,%ebx
  test   %ecx,%ecx
  jg     L4
  jmp    L107
L136:
  test   %r9d,%r9d
  jle    L169
  mov    -0x40(%rbp),%r11d
  lea    -0x1(%r11),%eax
  mov    -0x80(%rbp),%rbx
  lea    0x8(%rbx,%rax,8),%rdi
  mov    $0xffffffffffffffff,%rsi
  mov    $0x0,%r8d
  not    %rax
  lea    0x0(,%rax,8),%r10
  jmp    L314
L431:
  mov    (%rax),%rdx
  cmp    %rdx,%rsi
  mov    %rdx,%rcx
  cmovge %rsi,%rcx
  test   %rdx,%rdx
  cmovg  %rcx,%rsi
  add    $0x8,%rax
  cmp    %rax,%rdi
  jne    L431
L345:
  add    $0x1,%r8d
  add    -0x58(%rbp),%rdi
  cmp    %r8d,%r9d
  je     L473
L314:
  lea    (%r10,%rdi,1),%rax
  test   %r11d,%r11d
  jg     L431
  jmp    L345
L169:
  mov    $0xffffffffffffffff,%rsi
  jmp    L473
L1:
  mov    $0xffffffffffffffff,%rsi
L473:
  lea    D29(%rip),%rdi
  call   <printf@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L480
  mov    $0x0,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L480:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D39
datatype: string
name: parse_data
arguments: label: D29
datatype: string
name: parse_data
arguments: label: D17
datatype: string

tool: D39: %d %d

tool: D29: %ld

tool: D17: %d

assistant: ```c
int main(void) {
  int m, n;
  int i, j;
  scanf("%d %d", &m, &n);
  long L[m][n], rating[m][n];
  long tiles[m][n];
  for (i = 0; i < m; i++)
    for (j = 0; j < n; j++)
      scanf("%ld", &tiles[i][j]);
  int att, attraction[m][n];
  for (i = 0; i < m; i++)
    for (j = 0; j < n; j++) {
      scanf("%d", &att);
      if (att)
        attraction[i][j] = true;
      else
        attraction[i][j] = false;
    }
  int a, b;
  long maks;
  for (i = 0; i < m; i++)
    for (j = 0; j < n; j++) {
      maks = -1;
      if (attraction[i][j]) {
        djikstras(i, j, m, n, tiles, L);
        for (a = 0; a < m; a++)
          for (b = 0; b < n; b++)
            if (attraction[a][b])
              if (L[a][b] > maks)
                maks = L[a][b];
      }
      rating[i][j] = maks;
    }
  maks = -1;
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++)
      if (rating[i][j] > 0 && rating[i][j] > maks)
        maks = rating[i][j];
  }
  printf("%ld", maks);
  return 0;
}
```