user: 请将以下的汇编代码转换成C语言代码:

```asm
<tour>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x68,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %esi,-0x6c(%rbp)
  mov    %rdx,-0x78(%rbp)
  mov    %rcx,-0x80(%rbp)
  mov    %r8d,-0x70(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    -0x6c(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x48(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L30:
  cmp    %rdx,%rsp
  je     L38
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L30
L38:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L22
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L22:
  mov    %rsp,%rax
  add    $0x7,%rax
  shr    $0x3,%rax
  shl    $0x3,%rax
  mov    %rax,-0x40(%rbp)
  movl   $0x0,-0x5c(%rbp)
  movl   $0x0,-0x58(%rbp)
  jmp    L73
L58:
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x70(%rbp),%ecx
  mov    -0x78(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <arr_idx@plt>
  cmp    $0xffffffff,%eax
  je     L64
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x5c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x5c(%rbp)
  mov    (%rcx),%rcx
  mov    -0x40(%rbp),%rdx
  cltq
  mov    %rcx,(%rdx,%rax,8)
L64:
  addl   $0x1,-0x58(%rbp)
L73:
  mov    -0x58(%rbp),%eax
  cmp    -0x6c(%rbp),%eax
  jl     L58
  mov    -0x5c(%rbp),%eax
  mov    %eax,-0x6c(%rbp)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x70(%rbp),%ecx
  mov    -0x78(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <arr_idx@plt>
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x70(%rbp),%ecx
  mov    -0x80(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <arr_idx@plt>
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atof@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x50(%rbp)
  movl   $0x0,-0x54(%rbp)
  jmp    L4
L29:
  mov    -0x54(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x40(%rbp),%rax
  movslq %edx,%rdx
  mov    (%rax,%rdx,8),%rdx
  mov    -0x70(%rbp),%ecx
  mov    -0x78(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <arr_idx@plt>
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x70(%rbp),%ecx
  mov    -0x80(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <arr_idx@plt>
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atof@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x40(%rbp),%rax
  mov    -0x54(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,8),%rdx
  mov    -0x70(%rbp),%ecx
  mov    -0x78(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <arr_idx@plt>
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x70(%rbp),%ecx
  mov    -0x80(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <arr_idx@plt>
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atof@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x30(%rbp)
  movsd  -0x38(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  -0x30(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  subsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  movsd  -0x50(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  addl   $0x1,-0x54(%rbp)
L4:
  mov    -0x6c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x54(%rbp)
  jl     L29
  mov    -0x6c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x40(%rbp),%rax
  movslq %edx,%rdx
  mov    (%rax,%rdx,8),%rdx
  mov    -0x70(%rbp),%ecx
  mov    -0x78(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <arr_idx@plt>
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x70(%rbp),%ecx
  mov    -0x80(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <arr_idx@plt>
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atof@plt>
  movsd  -0x50(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  mov    -0x50(%rbp),%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  mov    %rbx,%rsp
  mov    -0x28(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L26
  call   <__stack_chk_fail@plt>
L26:
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
```

assistant: ```c
int tour(char **arrFriends, int szArrFriends, char **ftwns, char **townsDist, int szFTwns) {
  char *f_arr[szArrFriends];
  int temp_idx = 0;
  for (int i = 0; i < szArrFriends; ++i) {
    if (arr_idx(ftwns, szFTwns, arrFriends[i]) != -1)
      f_arr[temp_idx++] = arrFriends[i];
  }
  szArrFriends = temp_idx;
  double sum = atof(townsDist[arr_idx(townsDist, szFTwns, ftwns[arr_idx(ftwns, szFTwns, f_arr[0]) + 1]) + 1]);
  for (int i = 0; i < szArrFriends - 1; ++i) {
    double d1 = atof(townsDist[arr_idx(townsDist, szFTwns, ftwns[arr_idx(ftwns, szFTwns, f_arr[i + 1]) + 1]) + 1]);
    double d2 = atof(townsDist[arr_idx(townsDist, szFTwns, ftwns[arr_idx(ftwns, szFTwns, f_arr[i]) + 1]) + 1]);
    sum += sqrt(d1 * d1 - d2 * d2);
  }
  sum += atof(townsDist[arr_idx(townsDist, szFTwns, ftwns[arr_idx(ftwns, szFTwns, f_arr[szArrFriends - 1]) + 1]) + 1]);
  return floor(sum);
}
```