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

```asm
<dij>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  test   %ecx,%ecx
  jle    L367
  movslq %edi,%rax
  mov    %rdx,%rbx
  mov    %ecx,%edx
  mov    %rsi,%r13
  lea    (%rax,%rax,4),%r14
  shl    $0x2,%rdx
  lea    0x4(%rsp),%rdi
  mov    %ecx,%ebp
  shl    $0x3,%r14
  lea    (%rsi,%r14,1),%r15
  xor    %esi,%esi
  call   <memset@plt>
  lea    0x4(%rbx),%rax
  lea    0x8(%r13,%r14,1),%rdx
  sub    %rdx,%rax
  cmp    $0x8,%rax
  jbe    L230
  lea    -0x1(%rbp),%eax
  cmp    $0x2,%eax
  jbe    L230
  lea    0x4(%r13,%r14,1),%rax
  mov    %ebp,%edx
  movdqu (%rax),%xmm0
  shr    $0x2,%edx
  movups %xmm0,0x4(%rbx)
  cmp    $0x1,%edx
  je     L201
  movdqu 0x10(%rax),%xmm1
  movups %xmm1,0x14(%rbx)
L201:
  mov    %ebp,%eax
  and    $0xfffffffc,%eax
  lea    0x1(%rax),%edx
  cmp    %eax,%ebp
  je     L171
  mov    %eax,%ecx
  movslq %edx,%rdx
  lea    (%r15,%rcx,4),%rcx
  lea    0x0(,%rdx,4),%rsi
  mov    0x4(%rcx),%edi
  mov    %edi,(%rbx,%rdx,4)
  lea    0x2(%rax),%edx
  cmp    %edx,%ebp
  jl     L171
  mov    0x8(%rcx),%edx
  add    $0x3,%eax
  mov    %edx,0x4(%rbx,%rsi,1)
  cmp    %eax,%ebp
  jl     L171
  mov    0xc(%rcx),%eax
  mov    %eax,0x8(%rbx,%rsi,1)
L171:
  lea    0x1(%rbp),%r10d
  mov    $0x2,%r8d
  mov    $0x3e7,%r14d
  mov    $0x1,%r11d
  mov    $0x2,%r15d
L583:
  mov    0x4(%rbx),%edi
  mov    $0x3e7,%eax
  cmp    $0x3e6,%edi
  jg     L537
  mov    0x4(%rsp),%ecx
  mov    %r14d,%eax
  test   %ecx,%ecx
  cmove  %edi,%eax
  cmove  %r11d,%r12d
L537:
  mov    0x8(%rbx),%esi
  cmp    %esi,%eax
  jle    L411
  mov    0x8(%rsp),%edx
  test   %edx,%edx
  cmove  %esi,%eax
  cmove  %r15d,%r12d
L411:
  cmp    $0x2,%ebp
  jle    L469
  mov    0xc(%rbx),%edx
  cmp    %edx,%eax
  jle    L198
  mov    0xc(%rsp),%r9d
  test   %r9d,%r9d
  cmove  %edx,%eax
  mov    $0x3,%edx
  cmove  %edx,%r12d
L198:
  cmp    $0x3,%ebp
  je     L469
  mov    0x10(%rbx),%edx
  cmp    %edx,%eax
  jle    L281
  mov    0x10(%rsp),%ecx
  test   %ecx,%ecx
  cmove  %edx,%eax
  mov    $0x4,%edx
  cmove  %edx,%r12d
L281:
  cmp    $0x4,%ebp
  je     L469
  mov    0x14(%rbx),%edx
  cmp    %edx,%eax
  jle    L457
  mov    0x14(%rsp),%r9d
  test   %r9d,%r9d
  cmove  %edx,%eax
  mov    $0x5,%edx
  cmove  %edx,%r12d
L457:
  cmp    $0x5,%ebp
  je     L469
  mov    0x18(%rbx),%edx
  cmp    %edx,%eax
  jle    L222
  mov    0x18(%rsp),%ecx
  test   %ecx,%ecx
  cmove  %edx,%eax
  mov    $0x6,%edx
  cmove  %edx,%r12d
L222:
  cmp    $0x6,%ebp
  je     L469
  mov    0x1c(%rbx),%edx
  cmp    %edx,%eax
  jle    L194
  mov    0x1c(%rsp),%r9d
  test   %r9d,%r9d
  cmove  %edx,%eax
  mov    $0x7,%edx
  cmove  %edx,%r12d
L194:
  cmp    $0x7,%ebp
  je     L469
  mov    0x20(%rbx),%edx
  cmp    %edx,%eax
  jle    L346
  mov    0x20(%rsp),%ecx
  test   %ecx,%ecx
  cmove  %edx,%eax
  mov    $0x8,%edx
  cmove  %edx,%r12d
L346:
  cmp    $0x8,%ebp
  je     L469
  cmp    %eax,0x24(%rbx)
  jge    L469
  mov    0x24(%rsp),%r9d
  mov    $0x9,%eax
  test   %r9d,%r9d
  cmove  %eax,%r12d
L469:
  movslq %r12d,%rcx
  add    $0x1,%r8d
  lea    0x0(,%rcx,4),%rax
  movl   $0x1,(%rsp,%rcx,4)
  lea    (%rbx,%rax,1),%rdx
  add    %rcx,%rax
  lea    0x0(%r13,%rax,8),%rax
  mov    (%rdx),%ecx
  mov    0x4(%rax),%r9d
  add    %ecx,%r9d
  cmp    %edi,%r9d
  jge    L408
  mov    0x4(%rsp),%edi
  test   %edi,%edi
  jne    L408
  mov    %r9d,0x4(%rbx)
  mov    (%rdx),%ecx
L408:
  add    0x8(%rax),%ecx
  cmp    %esi,%ecx
  jge    L232
  mov    0x8(%rsp),%edi
  test   %edi,%edi
  jne    L232
  mov    %ecx,0x8(%rbx)
L232:
  cmp    $0x2,%ebp
  jle    L326
  mov    0xc(%rax),%ecx
  add    (%rdx),%ecx
  cmp    0xc(%rbx),%ecx
  jge    L586
  mov    0xc(%rsp),%esi
  test   %esi,%esi
  jne    L586
  mov    %ecx,0xc(%rbx)
L586:
  cmp    $0x3,%ebp
  je     L326
  mov    0x10(%rax),%ecx
  add    (%rdx),%ecx
  cmp    0x10(%rbx),%ecx
  jge    L569
  mov    0x10(%rsp),%r9d
  test   %r9d,%r9d
  jne    L569
  mov    %ecx,0x10(%rbx)
L569:
  cmp    $0x4,%ebp
  je     L326
  mov    0x14(%rax),%ecx
  add    (%rdx),%ecx
  cmp    0x14(%rbx),%ecx
  jge    L420
  mov    0x14(%rsp),%edi
  test   %edi,%edi
  jne    L420
  mov    %ecx,0x14(%rbx)
L420:
  cmp    $0x5,%ebp
  je     L326
  mov    0x18(%rax),%ecx
  add    (%rdx),%ecx
  cmp    0x18(%rbx),%ecx
  jge    L329
  mov    0x18(%rsp),%esi
  test   %esi,%esi
  jne    L329
  mov    %ecx,0x18(%rbx)
L329:
  cmp    $0x6,%ebp
  je     L326
  mov    0x1c(%rax),%ecx
  add    (%rdx),%ecx
  cmp    0x1c(%rbx),%ecx
  jge    L491
  mov    0x1c(%rsp),%r9d
  test   %r9d,%r9d
  jne    L491
  mov    %ecx,0x1c(%rbx)
L491:
  cmp    $0x7,%ebp
  je     L326
  mov    0x20(%rax),%ecx
  add    (%rdx),%ecx
  cmp    0x20(%rbx),%ecx
  jge    L288
  mov    0x20(%rsp),%edi
  test   %edi,%edi
  jne    L288
  mov    %ecx,0x20(%rbx)
L288:
  cmp    $0x8,%ebp
  je     L326
  mov    0x24(%rax),%eax
  add    (%rdx),%eax
  cmp    0x24(%rbx),%eax
  jge    L326
  mov    0x24(%rsp),%esi
  test   %esi,%esi
  jne    L326
  mov    %eax,0x24(%rbx)
  nopl   0x0(%rax,%rax,1)
L326:
  cmp    %r10d,%r8d
  jne    L583
L367:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L464
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L230:
  mov    0x4(%r15),%eax
  mov    %eax,0x4(%rbx)
  cmp    $0x1,%ebp
  je     L367
  mov    0x8(%r15),%eax
  mov    %eax,0x8(%rbx)
  cmp    $0x2,%ebp
  je     L171
  mov    0xc(%r15),%eax
  mov    %eax,0xc(%rbx)
  cmp    $0x3,%ebp
  je     L171
  mov    0x10(%r15),%eax
  mov    %eax,0x10(%rbx)
  cmp    $0x4,%ebp
  je     L171
  mov    0x14(%r15),%eax
  mov    %eax,0x14(%rbx)
  cmp    $0x5,%ebp
  je     L171
  mov    0x18(%r15),%eax
  mov    %eax,0x18(%rbx)
  cmp    $0x6,%ebp
  je     L171
  mov    0x1c(%r15),%eax
  mov    %eax,0x1c(%rbx)
  cmp    $0x7,%ebp
  je     L171
  mov    0x20(%r15),%eax
  mov    %eax,0x20(%rbx)
  cmp    $0x8,%ebp
  je     L171
  mov    0x24(%r15),%eax
  mov    %eax,0x24(%rbx)
  jmp    L171
L464:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void dij(int scr, int cost[][10], int *dist, int n) {
  int visited[10], min, i, count, u;
  for (i = 1; i <= n; i++)
    visited[i] = 0, dist[i] = cost[scr][i];
  count = 2;
  while (count <= n) {
    min = 999;
    for (i = 1; i <= n; i++)
      if (dist[i] < min && !visited[i])
        min = dist[i], u = i;
    visited[u] = 1;
    count++;
    for (i = 1; i <= n; i++)
      if ((dist[u] + cost[u][i] < dist[i]) && !visited[i])
        dist[i] = dist[u] + cost[u][i];
  }
}
```