user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<_optimal_solution>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  mov    %esi,%r15d
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <__builtin_huge_val@plt>
  movslq %r15d,%rdx
  mov    %rsp,%rdi
  lea    0xf(,%rdx,4),%rax
  movss  %xmm0,-0x44(%rbp)
  mov    %rax,%r8
  mov    %rax,%rsi
  and    $0xfffffffffffff000,%r8
  and    $0xfffffffffffffff0,%rsi
  sub    %r8,%rdi
  cmp    %rdi,%rsp
  je     L50
L9:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rdi,%rsp
  jne    L9
L50:
  and    $0xfff,%esi
  sub    %rsi,%rsp
  test   %rsi,%rsi
  jne    L74
L13:
  lea    0x3(%rsp),%rbx
  mov    %rax,%rsi
  mov    %rsp,%rdi
  and    $0xfffffffffffff000,%rax
  mov    %rbx,%rcx
  sub    %rax,%rdi
  and    $0xfffffffffffffffc,%rbx
  and    $0xfffffffffffffff0,%rsi
  shr    $0x2,%rcx
  mov    %rbx,-0x60(%rbp)
  mov    %rcx,-0x68(%rbp)
  cmp    %rdi,%rsp
  je     L87
L179:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rdi,%rsp
  jne    L179
L87:
  mov    %rsi,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  jne    L140
L65:
  mov    %rsp,%rbx
  xor    %eax,%eax
  test   %r15d,%r15d
  jle    L43
  nopl   (%rax)
L66:
  mov    %eax,(%rbx,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L66
L43:
  lea    -0x1(%r15),%r9d
  lea    0x4(%rbx),%rax
  mov    %rax,-0x50(%rbp)
  lea    0x4(,%r9,4),%rax
  mov    %r9,%r13
  lea    0x2(%r9),%r14
  mov    %rax,-0x58(%rbp)
  nopl   0x0(%rax,%rax,1)
L73:
  test   %r15d,%r15d
  jle    L3
  mov    $0x1,%esi
  pxor   %xmm0,%xmm0
  nopw   0x0(%rax,%rax,1)
L7:
  mov    %esi,%eax
  movslq -0x4(%rbx,%rsi,4),%rdi
  cvtss2sd %xmm0,%xmm0
  add    $0x1,%rsi
  cltd
  idiv   %r15d
  mov    (%r12,%rdi,8),%rax
  movslq %edx,%rdx
  movslq (%rbx,%rdx,4),%rdx
  addsd  (%rax,%rdx,8),%xmm0
  cvtsd2ss %xmm0,%xmm0
  cmp    %rsi,%r14
  jne    L7
  movss  -0x44(%rbp),%xmm1
  comiss %xmm0,%xmm1
  ja     L4
L142:
  mov    -0x50(%rbp),%rdi
  mov    %r13d,%esi
  call   <_next_permutation@plt>
  test   %rax,%rax
  jne    L73
  mov    -0x60(%rbp),%rbx
  mov    -0x58(%rbp),%r12
  lea    D18(%rip),%r13
  add    %rbx,%r12
  test   %r15d,%r15d
  jle    L149
  nopw   0x0(%rax,%rax,1)
L150:
  mov    (%rbx),%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %rbx,%r12
  jne    L150
L149:
  mov    -0x68(%rbp),%rax
  pxor   %xmm0,%xmm0
  lea    D10(%rip),%rdi
  cvtss2sd -0x44(%rbp),%xmm0
  mov    0x0(,%rax,4),%esi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L137
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L74:
  orq    $0x0,-0x8(%rsp,%rsi,1)
  jmp    L13
  nopl   0x0(%rax,%rax,1)
L4:
  mov    -0x58(%rbp),%rdx
  mov    -0x60(%rbp),%rdi
  mov    %rbx,%rsi
  movss  %xmm0,-0x44(%rbp)
  call   <memcpy@plt>
  jmp    L142
  nopw   0x0(%rax,%rax,1)
L3:
  pxor   %xmm2,%xmm2
  minss  -0x44(%rbp),%xmm2
  movss  %xmm2,-0x44(%rbp)
  jmp    L142
L140:
  orq    $0x0,-0x8(%rsp,%rax,1)
  jmp    L65
L137:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D18
type_infered: string
name: disassemble_data
arguments: tag: D10
type_infered: string

tool: D18: %d



tool: D10: %d

%.f

*



assistant: ```c
void _optimal_solution(double **input, int n) {
  double distance = 0;
  float best_cost = __builtin_huge_val();
  int best_path[n];
  int a[n];
  int i, j;
  for (i = 0; i < n; i++) {
    a[i] = i;
  };
  do {
    int l;
    float t = 0;
    for (l = 0; l < n; l++) {
      t += input[a[l]][a[(l + 1) % n]];
    }
    if (t < best_cost) {
      best_cost = t;
      for (l = 0; l < n; l++) {
        best_path[l] = a[l];
      }
    }
  } while (_next_permutation(&(a[0]) + 1, n - 1));
  for (i = 0; i < n; i++) {
    printf("%d\n\n", best_path[i]);
  }
  printf("%d\n\n%.f\n\n*\n\n", best_path[0], best_cost);
}
```