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

```asm
<main>:
  endbr64
  push   %r14
  lea    D3(%rip),%rdi
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x220,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x218(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rdx
  lea    0xc(%rsp),%rsi
  call   <scanf@plt>
  mov    0xc(%rsp),%ebx
  test   %ebx,%ebx
  jle    L164
  lea    0xa8(%rsp),%rsi
  lea    0x1(%rbx),%r9d
  mov    $0x1,%ecx
  xor    %edi,%edi
  mov    $0x3b9ac9ff,%r8d
  nopl   0x0(%rax)
L61:
  mov    $0x1,%eax
  nopl   (%rax)
L35:
  cmp    %eax,%ecx
  mov    %edi,%edx
  cmovne %r8d,%edx
  mov    %edx,(%rsi,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jge    L35
  add    $0x1,%ecx
  add    $0x28,%rsi
  cmp    %r9d,%ecx
  jne    L61
  mov    0x10(%rsp),%eax
  test   %eax,%eax
  jle    L191
L92:
  mov    $0x1,%ebx
  lea    0x1c(%rsp),%r14
  lea    0x18(%rsp),%r13
  lea    0x14(%rsp),%r12
  lea    D6(%rip),%rbp
  nopw   0x0(%rax,%rax,1)
L109:
  mov    %r13,%rdx
  mov    %r14,%rcx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  add    $0x1,%ebx
  call   <scanf@plt>
  movslq 0x14(%rsp),%rax
  movslq 0x18(%rsp),%rdx
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    0x1c(%rsp),%edx
  mov    %edx,0x80(%rsp,%rax,4)
  cmp    %ebx,0x10(%rsp)
  jge    L109
  mov    0xc(%rsp),%ebx
  test   %ebx,%ebx
  jle    L12
L191:
  mov    %ebx,%r12d
  lea    0x24(%rsp),%rdi
  lea    0xac(%rsp),%rsi
  shl    $0x2,%r12
  mov    %r12,%rdx
  call   <memcpy@plt>
  lea    0x54(%rsp),%rdi
  mov    %r12,%rdx
  xor    %esi,%esi
  call   <memset@plt>
  movl   $0x1,0x54(%rsp)
  cmp    $0x1,%ebx
  jle    L154
  mov    $0x1,%edx
  xor    %edi,%edi
  mov    $0x1,%r8d
  lea    0x20(%rsp),%rbp
  lea    0x80(%rsp),%r9
  nopl   0x0(%rax,%rax,1)
L147:
  mov    $0x1,%eax
  mov    $0x3b9ac9ff,%ecx
  jmp    L129
  nopl   0x0(%rax)
L8:
  mov    0x50(%rsp,%rax,4),%edx
L129:
  test   %edx,%edx
  jne    L63
  mov    0x0(%rbp,%rax,4),%edx
  cmp    %ecx,%edx
  jge    L63
  mov    %edx,%ecx
  mov    %eax,%edi
L63:
  add    $0x1,%rax
  cmp    %eax,%ebx
  jge    L8
  movslq %edi,%rsi
  movl   $0x1,0x50(%rsp,%rsi,4)
  lea    (%rsi,%rsi,4),%rax
  lea    (%r9,%rax,8),%rcx
  mov    $0x1,%eax
  nopl   0x0(%rax)
L142:
  mov    (%rcx,%rax,4),%edx
  cmp    $0x3b9ac9fe,%edx
  jg     L51
  add    0x20(%rsp,%rsi,4),%edx
  cmp    %edx,0x0(%rbp,%rax,4)
  jle    L51
  mov    %edx,0x0(%rbp,%rax,4)
L51:
  add    $0x1,%rax
  cmp    %eax,%ebx
  jge    L142
  add    $0x1,%r8d
  cmp    %ebx,%r8d
  jge    L87
  mov    0x54(%rsp),%edx
  jmp    L147
L154:
  lea    0x20(%rsp),%rbp
  nopl   (%rax)
L87:
  mov    $0x1,%ebx
  lea    D22(%rip),%r12
  nopl   0x0(%rax)
L186:
  mov    0x0(%rbp,%rbx,4),%esi
  mov    %r12,%rdi
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    %ebx,0xc(%rsp)
  jge    L186
L12:
  xor    %eax,%eax
  call   <getchar@plt>
  mov    0x218(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L179
  add    $0x220,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L164:
  cmpl   $0x0,0x10(%rsp)
  jg     L92
  jmp    L12
L179:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D3
type: string
name: unpack_data
arguments: tag: D6
type: string
name: unpack_data
arguments: tag: D22
type: string

tool: D3: %d %d

tool: D6: %d %d %d

tool: D22: %d 

assistant: ```c
int main(int argc, const char *argv[]) {
  int e[10][10], dis[10], book[10], i, j, n, m, t1, t2, t3, u, v, min;
  u = 0;
  int inf = 999999999;
  scanf("%d %d", &n, &m);
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      if (i == j) {
        e[i][j] = 0;
      } else {
        e[i][j] = inf;
      }
    }
  }
  for (i = 1; i <= m; i++) {
    scanf("%d %d %d", &t1, &t2, &t3);
    e[t1][t2] = t3;
  }
  for (i = 1; i <= n; i++) {
    dis[i] = e[1][i];
  }
  for (i = 1; i <= n; i++) {
    book[i] = 0;
  }
  book[1] = 1;
  for (i = 1; i < n; i++) {
    min = inf;
    for (j = 1; j <= n; j++) {
      if (book[j] == 0 && dis[j] < min) {
        min = dis[j];
        u = j;
      }
    }
    book[u] = 1;
    for (v = 1; v <= n; v++) {
      if (e[u][v] < inf) {
        if (dis[v] > dis[u] + e[u][v]) {
          dis[v] = dis[u] + e[u][v];
        }
      }
    }
  }
  for (i = 1; i <= n; i++) {
    printf("%d ", dis[i]);
  }
  getchar();
  return 0;
}
```