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

```asm
<wedge>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %esi,(%rsp)
  mov    %rcx,0x8(%rsp)
  mov    0x50(%rsp),%rax
  movl   $0x0,(%rax)
  test   %esi,%esi
  je     L338
  mov    %rdi,%r13
  mov    %rdx,%r12
  mov    %r8,%rbp
  mov    %r9,%rbx
  mov    $0x0,%r14d
L273:
  movslq %r14d,%r15
  lea    0x0(%r13,%r15,8),%rdi
  mov    D7(%rip),%rax
  movq   %rax,%xmm0
  mov    %rbx,%rsi
  call   <s_unit2@plt>
  mov    %eax,0x4(%rsp)
  test   %eax,%eax
  je     L240
  mov    (%r12,%r15,4),%r14d
  cmp    %r14d,(%rsp)
  jne    L273
L338:
  movl   $0x2,0x4(%rsp)
  jmp    L245
L240:
  movss  0x4(%rbx),%xmm0
  movss  %xmm0,0x0(%rbp)
  movss  (%rbx),%xmm2
  movss  D26(%rip),%xmm1
  xorps  %xmm1,%xmm2
  movss  %xmm2,0x4(%rbp)
  xorps  %xmm1,%xmm0
  movss  %xmm0,(%rbx)
  movss  0x4(%rbp),%xmm0
  xorps  %xmm1,%xmm0
  movss  %xmm0,0x4(%rbx)
  cmp    %r14d,(%rsp)
  je     L58
  mov    %eax,%r14d
  jmp    L98
L26:
  cvtss2sd %xmm1,%xmm1
  comisd D36(%rip),%xmm1
  jb     L217
  movsd  D91(%rip),%xmm1
  comisd %xmm0,%xmm1
  jb     L64
  xorps  D26(%rip),%xmm2
  movss  %xmm2,(%rbx)
  movss  (%rax),%xmm0
  movss  %xmm0,0x4(%rbx)
  movsd  D7(%rip),%xmm0
  mov    %rbx,%rsi
  mov    %rbx,%rdi
  call   <s_unit2@plt>
  jmp    L289
L217:
  movsd  D91(%rip),%xmm6
  comisd %xmm0,%xmm6
  jb     L85
  comisd %xmm1,%xmm6
  jae    L245
  movsd  D91(%rip),%xmm0
  comisd %xmm1,%xmm0
  jae    L171
L325:
  movsd  D91(%rip),%xmm0
  comisd %xmm1,%xmm0
  jae    L171
L199:
  movsd  D7(%rip),%xmm0
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <s_unit2@plt>
  jmp    L63
L85:
  movsd  D91(%rip),%xmm6
  comisd %xmm1,%xmm6
  jb     L219
L171:
  movsd  D7(%rip),%xmm0
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <s_unit2@plt>
  jmp    L63
L219:
  comisd %xmm0,%xmm6
  jae    L325
  mulss  %xmm2,%xmm4
  mulss  %xmm5,%xmm3
  subss  %xmm3,%xmm4
  pxor   %xmm2,%xmm2
  comiss %xmm4,%xmm2
  jbe    L64
  comisd %xmm1,%xmm6
  jae    L171
  movsd  D91(%rip),%xmm1
  comisd %xmm0,%xmm1
  jae    L199
L63:
  mov    0x50(%rsp),%rax
  movl   $0x1,(%rax)
L289:
  mov    0x8(%rsp),%rdx
  mov    %r12,%rsi
  mov    %r14d,%edi
  call   <move_to_front@plt>
  mov    %eax,%r14d
L64:
  movslq %r14d,%r14
  mov    (%r12,%r14,4),%r14d
  mov    0x50(%rsp),%rax
  cmpl   $0x0,(%rax)
  jne    L227
  cmp    %r14d,(%rsp)
  je     L131
L98:
  movss  0x0(%rbp),%xmm4
  movslq %r14d,%rax
  lea    0x0(%r13,%rax,8),%rax
  movss  (%rax),%xmm3
  movss  0x4(%rbp),%xmm5
  movss  0x4(%rax),%xmm2
  movaps %xmm4,%xmm0
  mulss  %xmm3,%xmm0
  movaps %xmm5,%xmm1
  mulss  %xmm2,%xmm1
  addss  %xmm0,%xmm1
  movaps %xmm3,%xmm0
  mulss  (%rbx),%xmm0
  movaps %xmm2,%xmm6
  mulss  0x4(%rbx),%xmm6
  addss  %xmm6,%xmm0
  cvtss2sd %xmm0,%xmm0
  comisd D36(%rip),%xmm0
  jb     L26
  pxor   %xmm0,%xmm0
  cvtss2sd %xmm1,%xmm0
  movsd  D91(%rip),%xmm1
  comisd %xmm0,%xmm1
  jb     L64
  movss  %xmm2,0x0(%rbp)
  movss  (%rax),%xmm0
  xorps  D26(%rip),%xmm0
  movss  %xmm0,0x4(%rbp)
  movsd  D7(%rip),%xmm0
  mov    %rbp,%rsi
  mov    %rbp,%rdi
  call   <s_unit2@plt>
  jmp    L289
L131:
  movl   $0x1,0x4(%rsp)
L245:
  mov    0x4(%rsp),%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L32:
  cvtss2sd %xmm1,%xmm1
  comisd %xmm1,%xmm8
  jbe    L294
  movss  %xmm4,(%rbx)
  movss  0x4(%rbp),%xmm0
  movss  %xmm0,0x4(%rbx)
L294:
  mov    (%r12,%r14,4),%r14d
  cmp    %r14d,(%rsp)
  je     L61
L206:
  movss  0x0(%rbp),%xmm4
  movslq %r14d,%r14
  lea    0x0(%r13,%r14,8),%rax
  movss  (%rax),%xmm2
  movss  0x4(%rax),%xmm0
  movss  (%rbx),%xmm3
  movaps %xmm0,%xmm1
  mulss  0x4(%rbx),%xmm1
  movaps %xmm2,%xmm5
  mulss  %xmm3,%xmm5
  addss  %xmm5,%xmm1
  mulss  0x4(%rbp),%xmm0
  mulss  %xmm4,%xmm2
  addss  %xmm2,%xmm0
  cvtss2sd %xmm0,%xmm0
  comisd %xmm0,%xmm6
  jbe    L32
  cvtss2sd %xmm1,%xmm1
  comisd %xmm1,%xmm7
  ja     L245
  movss  %xmm3,0x0(%rbp)
  movss  0x4(%rbx),%xmm0
  movss  %xmm0,0x4(%rbp)
  jmp    L294
L61:
  movl   $0x1,0x4(%rsp)
  jmp    L245
L58:
  movl   $0x2,0x4(%rsp)
  jmp    L245
L227:
  cmp    %r14d,(%rsp)
  je     L6
  movsd  D91(%rip),%xmm6
  movapd %xmm6,%xmm8
  movapd %xmm6,%xmm7
  jmp    L206
L6:
  movl   $0x1,0x4(%rsp)
  jmp    L245
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D7
type_guessed: byte[8]
name: extract_symbolic_data
arguments: data_tag: D26
type_guessed: byte[16]
name: extract_symbolic_data
arguments: data_tag: D36
type_guessed: byte[16]
name: extract_symbolic_data
arguments: data_tag: D91
type_guessed: byte[8]

tool: {"D7": [0x48,0xaf,0xbc,0x9a,0xf2,0xd7,0x7a,0x3e]}

tool: {"D26": [0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: {"D36": [0x48,0xaf,0xbc,0x9a,0xf2,0xd7,0x8a,0x3e,0x48,0xaf,0xbc,0x9a,0xf2,0xd7,0x8a,0xbe]}

tool: {"D91": [0x48,0xaf,0xbc,0x9a,0xf2,0xd7,0x8a,0xbe]}

assistant: ```c
int wedge(float halves[][2], int m, int next[], int prev[], float cw_vec[], float ccw_vec[], int *degen) {
  int i;
  float d_cw, d_ccw;
  int offensive;
  *degen = 0;
  for (i = 0; i != m; i = next[i]) {
    if (!s_unit2(halves[i], ccw_vec, 1.0e-7)) {
      cw_vec[0] = ccw_vec[1];
      cw_vec[1] = -ccw_vec[0];
      ccw_vec[0] = -cw_vec[0];
      ccw_vec[1] = -cw_vec[1];
      break;
    }
  }
  if (i == m)
    return (2);
  i = 0;
  while (i != m) {
    offensive = 0;
    d_cw = ((cw_vec)[0] * (halves[i])[0] + (cw_vec)[1] * (halves[i])[1]);
    d_ccw = ((ccw_vec)[0] * (halves[i])[0] + (ccw_vec)[1] * (halves[i])[1]);
    if (d_ccw >= 2 * 1.0e-7) {
      if (d_cw <= -2 * 1.0e-7) {
        cw_vec[0] = halves[i][1];
        cw_vec[1] = -halves[i][0];
        (void)s_unit2(cw_vec, cw_vec, 1.0e-7);
        offensive = 1;
      }
    } else if (d_cw >= 2 * 1.0e-7) {
      if (d_ccw <= -2 * 1.0e-7) {
        ccw_vec[0] = -halves[i][1];
        ccw_vec[1] = halves[i][0];
        (void)s_unit2(ccw_vec, ccw_vec, 1.0e-7);
        offensive = 1;
      }
    } else if (d_ccw <= -2 * 1.0e-7 && d_cw <= -2 * 1.0e-7) {
      return (0);
    } else if ((d_cw <= -2 * 1.0e-7) || (d_ccw <= -2 * 1.0e-7) || (((cw_vec)[0] * (halves[i])[1] - (cw_vec)[1] * (halves[i])[0]) < 0.0)) {
      if (d_cw <= -2 * 1.0e-7) {
        (void)s_unit2(ccw_vec, cw_vec, 1.0e-7);
      } else if (d_ccw <= -2 * 1.0e-7) {
        (void)s_unit2(cw_vec, ccw_vec, 1.0e-7);
      }
      *degen = 1;
      offensive = 1;
    }
    if (offensive)
      i = move_to_front(i, next, prev);
    i = next[i];
    if (*degen)
      break;
  }
  if (*degen) {
    while (i != m) {
      d_cw = ((cw_vec)[0] * (halves[i])[0] + (cw_vec)[1] * (halves[i])[1]);
      d_ccw = ((ccw_vec)[0] * (halves[i])[0] + (ccw_vec)[1] * (halves[i])[1]);
      if (d_cw < -2 * 1.0e-7) {
        if (d_ccw < -2 * 1.0e-7) {
          return (0);
        } else {
          cw_vec[0] = ccw_vec[0];
          cw_vec[1] = ccw_vec[1];
        }
      } else if (d_ccw < -2 * 1.0e-7) {
        ccw_vec[0] = cw_vec[0];
        ccw_vec[1] = cw_vec[1];
      }
      i = next[i];
    }
  }
  return (1);
}
```