user: 请从给定的汇编指令推导出C源代码:

```asm
<nth>:
  endbr64
  push   %rbx
  sub    $0x10,%rsp
  mov    %rsi,%rbx
  movaps %xmm0,%xmm1
  lea    -0x1(%rdi),%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  comiss %xmm0,%xmm1
  jae    L17
  cmp    $0x1,%edi
  je     L89
  pxor   %xmm0,%xmm0
  comiss %xmm1,%xmm0
  ja     L89
  cmp    $0x2,%edi
  jg     L78
  movss  (%rsi),%xmm2
  movss  0x4(%rsi),%xmm3
  comiss %xmm2,%xmm3
  jbe    L259
  pxor   %xmm4,%xmm4
  cvtss2sd %xmm1,%xmm4
  movsd  D13(%rip),%xmm0
  subsd  %xmm4,%xmm0
  cvtss2sd %xmm2,%xmm2
  mulsd  %xmm2,%xmm0
  mulss  %xmm1,%xmm3
  cvtss2sd %xmm3,%xmm3
  addsd  %xmm3,%xmm0
  cvtsd2ss %xmm0,%xmm0
  jmp    L18
L17:
  movslq %edi,%rdi
  movss  -0x4(%rsi,%rdi,4),%xmm0
L18:
  add    $0x10,%rsp
  pop    %rbx
  ret
L89:
  movss  (%rbx),%xmm0
  jmp    L18
L259:
  pxor   %xmm4,%xmm4
  cvtss2sd %xmm1,%xmm4
  movsd  D13(%rip),%xmm0
  subsd  %xmm4,%xmm0
  cvtss2sd %xmm3,%xmm3
  mulsd  %xmm3,%xmm0
  mulss  %xmm1,%xmm2
  cvtss2sd %xmm2,%xmm2
  addsd  %xmm2,%xmm0
  cvtsd2ss %xmm0,%xmm0
  jmp    L18
L78:
  movss  (%rsi),%xmm0
  mov    %edi,%edx
  mov    $0x1,%r8d
  mov    $0x1,%eax
  jmp    L4
L113:
  ucomiss %xmm0,%xmm2
  jp     L57
  jne    L57
  movslq %r8d,%rsi
  lea    (%rbx,%rsi,4),%rsi
  movss  (%rsi),%xmm3
  movss  %xmm3,(%rcx)
  movss  %xmm2,(%rsi)
  add    $0x1,%r8d
L57:
  add    $0x1,%eax
  cmp    %eax,%edx
  jle    L87
L4:
  movslq %eax,%rcx
  lea    (%rbx,%rcx,4),%rcx
  movss  (%rcx),%xmm2
  comiss %xmm0,%xmm2
  jbe    L113
  movslq %edx,%rsi
  lea    -0x4(%rbx,%rsi,4),%rsi
  movss  (%rsi),%xmm3
  movss  %xmm3,(%rcx)
  movss  %xmm2,(%rsi)
  sub    $0x1,%edx
  sub    $0x1,%eax
  jmp    L57
L87:
  cmp    %edi,%edx
  je     L36
  mov    %edx,%eax
  sub    %r8d,%eax
  lea    -0x1(%rax),%ecx
  pxor   %xmm2,%xmm2
  cvtsi2ss %ecx,%xmm2
  comiss %xmm1,%xmm2
  ja     L187
  pxor   %xmm3,%xmm3
  cvtsi2ss %eax,%xmm3
  comiss %xmm1,%xmm3
  ja     L68
  lea    -0x1(%rdx),%eax
  pxor   %xmm2,%xmm2
  cvtsi2ss %eax,%xmm2
  comiss %xmm1,%xmm2
  jae    L18
  pxor   %xmm0,%xmm0
  cvtsi2ss %edx,%xmm0
  comiss %xmm1,%xmm0
  jbe    L154
  subss  %xmm2,%xmm1
  movaps %xmm1,%xmm6
  pxor   %xmm1,%xmm1
  cvtss2sd (%rbx),%xmm1
  movss  %xmm6,0x4(%rsp)
  pxor   %xmm2,%xmm2
  cvtss2sd %xmm6,%xmm2
  movsd  D13(%rip),%xmm0
  subsd  %xmm2,%xmm0
  movapd %xmm1,%xmm7
  mulsd  %xmm0,%xmm7
  movsd  %xmm7,0x8(%rsp)
  movslq %edx,%rax
  lea    (%rbx,%rax,4),%rsi
  sub    %edx,%edi
  call   <floatmin@plt>
  mulss  0x4(%rsp),%xmm0
  cvtss2sd %xmm0,%xmm0
  addsd  0x8(%rsp),%xmm0
  cvtsd2ss %xmm0,%xmm0
  jmp    L18
L36:
  sub    %r8d,%edx
  pxor   %xmm2,%xmm2
  cvtsi2ss %edx,%xmm2
  comiss %xmm2,%xmm1
  jae    L18
  lea    -0x1(%rdx),%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  comiss %xmm1,%xmm0
  jbe    L79
  movslq %r8d,%r8
  lea    (%rbx,%r8,4),%rsi
  movaps %xmm1,%xmm0
  mov    %edx,%edi
  call   <nth>
  jmp    L18
L79:
  subss  %xmm0,%xmm1
  movss  %xmm1,0x4(%rsp)
  movslq %r8d,%r8
  lea    (%rbx,%r8,4),%rsi
  mov    %edx,%edi
  call   <floatmax@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movss  0x4(%rsp),%xmm5
  pxor   %xmm2,%xmm2
  cvtss2sd %xmm5,%xmm2
  movsd  D13(%rip),%xmm1
  subsd  %xmm2,%xmm1
  mulsd  %xmm1,%xmm0
  mulss  (%rbx),%xmm5
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm5,%xmm1
  addsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  jmp    L18
L187:
  movslq %r8d,%r8
  lea    (%rbx,%r8,4),%rsi
  movaps %xmm1,%xmm0
  mov    %eax,%edi
  call   <nth>
  jmp    L18
L68:
  subss  %xmm2,%xmm1
  movss  %xmm1,0x4(%rsp)
  movslq %r8d,%r8
  lea    (%rbx,%r8,4),%rsi
  mov    %eax,%edi
  call   <floatmax@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movss  0x4(%rsp),%xmm7
  pxor   %xmm2,%xmm2
  cvtss2sd %xmm7,%xmm2
  movsd  D13(%rip),%xmm1
  subsd  %xmm2,%xmm1
  mulsd  %xmm1,%xmm0
  mulss  (%rbx),%xmm7
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm7,%xmm1
  addsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  jmp    L18
L154:
  subss  %xmm0,%xmm1
  movslq %edx,%rax
  lea    (%rbx,%rax,4),%rsi
  sub    %edx,%edi
  movaps %xmm1,%xmm0
  call   <nth>
  jmp    L18
```

tool_calls: name: extract_symbolic_data
arguments: tag: D13
datatype: f64

tool: D13: 1

assistant: ```c
float nth(int ndat, float *dat, float n) {
  float a, temp;
  int i, nmax;
  float s;
  int nsame;
  if (n >= ndat - 1)
    return dat[ndat - 1];
  if (ndat == 1 || n < 0)
    return dat[0];
  if (ndat <= 2) {
    if (dat[0] < dat[1])
      return (dat[0] * (1. - n) + n * dat[1]);
    else
      return (dat[1] * (1. - n) + n * dat[0]);
  }
  a = dat[0];
  nmax = ndat;
  nsame = 1;
  for (i = 1; i < nmax; i++) {
    if (dat[i] > a) {
      temp = dat[i];
      dat[i] = dat[nmax - 1];
      dat[nmax - 1] = temp;
      nmax--;
      i--;
    } else if (dat[i] == a) {
      temp = dat[i];
      dat[i] = dat[nsame];
      dat[nsame] = temp;
      nsame++;
    }
  }
  if (nmax == ndat) {
    if (nmax - nsame <= n) {
      return a;
    } else if (nmax - nsame - 1 > n) {
      return nth(nmax - nsame, dat + nsame, n);
    } else {
      s = n - (nmax - nsame - 1);
      return (floatmax(nmax - nsame, dat + nsame) * (1. - s) + s * dat[0]);
    }
  }
  if (n < nmax - nsame - 1) {
    return nth(nmax - nsame, dat + nsame, n);
  } else if (n < nmax - nsame) {
    s = n - (nmax - nsame - 1);
    return (floatmax(nmax - nsame, dat + nsame) * (1. - s) + s * dat[0]);
  } else if (n <= nmax - 1) {
    return a;
  } else if (n < nmax) {
    s = n - (nmax - 1);
    return (dat[0] * (1. - s) + s * floatmin(ndat - nmax, dat + nmax));
  } else {
    return nth(ndat - nmax, dat + nmax, n - nmax);
  }
}
```