user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r12
  push   %rbx
  sub    $0x90,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  lea    -0x7c(%rbp),%rax
  mov    %rax,%rsi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  jmp    L47
L117:
  mov    %rsp,%rax
  mov    %rax,%r12
  lea    -0x78(%rbp),%rax
  mov    %rax,%rsi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  lea    -0x70(%rbp),%rdx
  lea    -0x74(%rbp),%rax
  mov    %rax,%rsi
  lea    D51(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x78(%rbp),%eax
  cltq
  shl    $0x3,%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x50(%rbp)
  movl   $0x0,-0x64(%rbp)
  jmp    L59
L63:
  mov    -0x78(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x50(%rbp),%rax
  lea    (%rcx,%rax,1),%rbx
  mov    %edx,%edi
  call   <malloc@plt>
  mov    %rax,(%rbx)
  mov    -0x78(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x50(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  mov    $0xffffffff,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  addl   $0x1,-0x64(%rbp)
L59:
  mov    -0x78(%rbp),%eax
  cmp    %eax,-0x64(%rbp)
  jl     L63
  movl   $0x0,-0x60(%rbp)
  jmp    L178
L152:
  lea    -0x68(%rbp),%rdx
  lea    -0x6c(%rbp),%rax
  mov    %rax,%rsi
  lea    D51(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x6c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x68(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  addl   $0x1,-0x60(%rbp)
L178:
  mov    -0x78(%rbp),%eax
  cmp    %eax,-0x60(%rbp)
  jl     L152
  lea    -0x68(%rbp),%rax
  mov    %rax,%rsi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x78(%rbp),%ecx
  movslq %ecx,%rax
  sub    $0x1,%rax
  mov    %rax,-0x48(%rbp)
  movslq %ecx,%rax
  mov    %rax,%r14
  mov    $0x0,%r15d
  movslq %ecx,%rax
  mov    %rax,-0x90(%rbp)
  movq   $0x0,-0x88(%rbp)
  movslq %ecx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%ebx
  mov    $0x0,%edx
  div    %rbx
  imul   $0x10,%rax,%rax
  mov    %rax,%rsi
  and    $0xfffffffffffff000,%rsi
  mov    %rsp,%rdx
  sub    %rsi,%rdx
L2:
  cmp    %rdx,%rsp
  je     L72
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L2
L72:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L24
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L24:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x40(%rbp)
  movslq %ecx,%rax
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    -0x40(%rbp),%rax
  mov    $0x3f3f3f3f,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x78(%rbp),%ecx
  movslq %ecx,%rax
  sub    $0x1,%rax
  mov    %rax,-0x38(%rbp)
  movslq %ecx,%rax
  mov    %rax,-0xa0(%rbp)
  movq   $0x0,-0x98(%rbp)
  movslq %ecx,%rax
  mov    %rax,-0xb0(%rbp)
  movq   $0x0,-0xa8(%rbp)
  movslq %ecx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%ebx
  mov    $0x0,%edx
  div    %rbx
  imul   $0x10,%rax,%rax
  mov    %rax,%rsi
  and    $0xfffffffffffff000,%rsi
  mov    %rsp,%rdx
  sub    %rsi,%rdx
L119:
  cmp    %rdx,%rsp
  je     L134
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L119
L134:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L172
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L172:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x30(%rbp)
  movslq %ecx,%rax
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    $0xffffffff,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0x0,-0x5c(%rbp)
  mov    -0x74(%rbp),%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x74(%rbp),%edx
  mov    -0x40(%rbp),%rax
  movslq %edx,%rdx
  movl   $0x0,(%rax,%rdx,4)
  jmp    L31
L192:
  mov    -0x30(%rbp),%rax
  mov    -0x5c(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  mov    %eax,-0x54(%rbp)
  subl   $0x1,-0x5c(%rbp)
  movl   $0x0,-0x58(%rbp)
  jmp    L157
L19:
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x58(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0xffffffff,%eax
  je     L109
  mov    -0x40(%rbp),%rax
  mov    -0x54(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%edx
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x50(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x58(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x40(%rbp),%rax
  mov    -0x58(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  cmp    %eax,%ecx
  jge    L109
  mov    -0x40(%rbp),%rax
  mov    -0x54(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%edx
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x50(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x58(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x40(%rbp),%rax
  mov    -0x58(%rbp),%edx
  movslq %edx,%rdx
  mov    %ecx,(%rax,%rdx,4)
  addl   $0x1,-0x5c(%rbp)
  mov    -0x30(%rbp),%rax
  mov    -0x5c(%rbp),%edx
  movslq %edx,%rdx
  mov    -0x58(%rbp),%ecx
  mov    %ecx,(%rax,%rdx,4)
L109:
  addl   $0x1,-0x58(%rbp)
L157:
  mov    -0x70(%rbp),%eax
  cmp    %eax,-0x54(%rbp)
  je     L31
  mov    -0x78(%rbp),%eax
  cmp    %eax,-0x58(%rbp)
  jl     L19
L31:
  cmpl   $0x0,-0x5c(%rbp)
  jns    L192
  mov    -0x70(%rbp),%edx
  mov    -0x40(%rbp),%rax
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  mov    %eax,%esi
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    %r12,%rsp
L47:
  mov    -0x7c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x7c(%rbp)
  test   %eax,%eax
  jne    L117
  mov    $0x0,%eax
  mov    -0x28(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L124
  call   <__stack_chk_fail@plt>
L124:
  lea    -0x20(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: label: D6
type_guessed: string
name: retrieve_data
arguments: label: D51
type_guessed: string
name: retrieve_data
arguments: label: D23
type_guessed: string

tool: D6: %d

tool: D51: %d %d

tool: D23: %d


assistant: ```c
int main() {
  int cases;
  scanf("%d", &cases);
  while (cases--) {
    int roads;
    scanf("%d", &roads);
    int start, end;
    scanf("%d %d", &start, &end);
    int **Map = malloc(roads * sizeof(int *) + 1);
    for (int x = 0; x < roads; x++) {
      Map[x] = malloc(roads * sizeof(int));
      memset(Map[x], -1, roads * sizeof(int));
    }
    for (int x = 0; x < roads; x++) {
      int from, to;
      scanf("%d %d", &from, &to);
      scanf("%d", &Map[from][to]);
    }
    int ignore;
    scanf("%d", &ignore);
    int mincost[roads];
    memset(mincost, 0x3f3f3f3f, sizeof(mincost));
    int stack[roads];
    memset(stack, -1, sizeof(stack));
    int sidx = 0;
    stack[0] = start;
    mincost[start] = 0;
    while (sidx >= 0) {
      int curnode = stack[sidx];
      --sidx;
      for (int x = 0; curnode != end && x < roads; x++) {
        if (Map[curnode][x] != -1 && mincost[curnode] + Map[curnode][x] < mincost[x]) {
          mincost[x] = mincost[curnode] + Map[curnode][x];
          stack[++sidx] = x;
        }
      }
    }
    printf("%d\n", mincost[end]);
  }
  return 0;
}
```