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

```asm
<wedge>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8,-0x38(%rbp)
  mov    %r9,-0x40(%rbp)
  mov    0x10(%rbp),%rax
  movl   $0x0,(%rax)
  movl   $0x0,-0x10(%rbp)
  jmp    L258
L294:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    D180(%rip),%rdx
  mov    -0x40(%rbp),%rax
  movq   %rdx,%xmm0
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <s_unit2@plt>
  test   %eax,%eax
  jne    L99
  mov    -0x40(%rbp),%rax
  movss  0x4(%rax),%xmm0
  mov    -0x38(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0x40(%rbp),%rax
  movss  (%rax),%xmm0
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movss  D139(%rip),%xmm1
  xorps  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x38(%rbp),%rax
  movss  (%rax),%xmm0
  movss  D139(%rip),%xmm1
  xorps  %xmm1,%xmm0
  mov    -0x40(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm0
  mov    -0x40(%rbp),%rax
  add    $0x4,%rax
  movss  D139(%rip),%xmm1
  xorps  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  jmp    L159
L99:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x10(%rbp)
L258:
  mov    -0x10(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jne    L294
L159:
  mov    -0x10(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jne    L229
  mov    $0x2,%eax
  jmp    L268
L229:
  movl   $0x0,-0x10(%rbp)
  jmp    L71
L143:
  movl   $0x0,-0xc(%rbp)
  mov    -0x38(%rbp),%rax
  movss  (%rax),%xmm1
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  %xmm0,%xmm1
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm2
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movss  0x4(%rax),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x8(%rbp)
  mov    -0x40(%rbp),%rax
  movss  (%rax),%xmm1
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  %xmm0,%xmm1
  mov    -0x40(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm2
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movss  0x4(%rax),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x4(%rbp)
  pxor   %xmm0,%xmm0
  cvtss2sd -0x4(%rbp),%xmm0
  comisd D8(%rip),%xmm0
  jb     L16
  pxor   %xmm1,%xmm1
  cvtss2sd -0x8(%rbp),%xmm1
  movsd  D94(%rip),%xmm0
  comisd %xmm1,%xmm0
  jb     L203
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movss  0x4(%rax),%xmm0
  mov    -0x38(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movss  D139(%rip),%xmm1
  xorps  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  mov    D180(%rip),%rcx
  mov    -0x38(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  movq   %rcx,%xmm0
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <s_unit2@plt>
  movl   $0x1,-0xc(%rbp)
  jmp    L203
L16:
  pxor   %xmm0,%xmm0
  cvtss2sd -0x8(%rbp),%xmm0
  comisd D8(%rip),%xmm0
  jb     L201
  pxor   %xmm1,%xmm1
  cvtss2sd -0x4(%rbp),%xmm1
  movsd  D94(%rip),%xmm0
  comisd %xmm1,%xmm0
  jb     L203
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movss  0x4(%rax),%xmm0
  movss  D139(%rip),%xmm1
  xorps  %xmm1,%xmm0
  mov    -0x40(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x40(%rbp),%rax
  add    $0x4,%rax
  movss  (%rdx),%xmm0
  movss  %xmm0,(%rax)
  mov    D180(%rip),%rcx
  mov    -0x40(%rbp),%rdx
  mov    -0x40(%rbp),%rax
  movq   %rcx,%xmm0
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <s_unit2@plt>
  movl   $0x1,-0xc(%rbp)
  jmp    L203
L201:
  pxor   %xmm1,%xmm1
  cvtss2sd -0x4(%rbp),%xmm1
  movsd  D94(%rip),%xmm0
  comisd %xmm1,%xmm0
  jb     L119
  pxor   %xmm1,%xmm1
  cvtss2sd -0x8(%rbp),%xmm1
  movsd  D94(%rip),%xmm0
  comisd %xmm1,%xmm0
  jb     L119
  mov    $0x0,%eax
  jmp    L268
L119:
  pxor   %xmm1,%xmm1
  cvtss2sd -0x8(%rbp),%xmm1
  movsd  D94(%rip),%xmm0
  comisd %xmm1,%xmm0
  jae    L313
  pxor   %xmm1,%xmm1
  cvtss2sd -0x4(%rbp),%xmm1
  movsd  D94(%rip),%xmm0
  comisd %xmm1,%xmm0
  jae    L313
  mov    -0x38(%rbp),%rax
  movss  (%rax),%xmm1
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movss  0x4(%rax),%xmm0
  mulss  %xmm1,%xmm0
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm2
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mulss  %xmm1,%xmm2
  movaps %xmm0,%xmm1
  subss  %xmm2,%xmm1
  pxor   %xmm0,%xmm0
  comiss %xmm1,%xmm0
  jbe    L203
L313:
  pxor   %xmm1,%xmm1
  cvtss2sd -0x8(%rbp),%xmm1
  movsd  D94(%rip),%xmm0
  comisd %xmm1,%xmm0
  jb     L47
  mov    D180(%rip),%rcx
  mov    -0x38(%rbp),%rdx
  mov    -0x40(%rbp),%rax
  movq   %rcx,%xmm0
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <s_unit2@plt>
  jmp    L179
L47:
  pxor   %xmm1,%xmm1
  cvtss2sd -0x4(%rbp),%xmm1
  movsd  D94(%rip),%xmm0
  comisd %xmm1,%xmm0
  jb     L179
  mov    D180(%rip),%rcx
  mov    -0x40(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  movq   %rcx,%xmm0
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <s_unit2@plt>
L179:
  mov    0x10(%rbp),%rax
  movl   $0x1,(%rax)
  movl   $0x1,-0xc(%rbp)
L203:
  cmpl   $0x0,-0xc(%rbp)
  je     L9
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rcx
  mov    -0x10(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <move_to_front@plt>
  mov    %eax,-0x10(%rbp)
L9:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L141
L71:
  mov    -0x10(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jne    L143
  jmp    L254
L141:
  nop
L254:
  mov    0x10(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L263
  jmp    L200
L288:
  mov    -0x38(%rbp),%rax
  movss  (%rax),%xmm1
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  %xmm0,%xmm1
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm2
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movss  0x4(%rax),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x8(%rbp)
  mov    -0x40(%rbp),%rax
  movss  (%rax),%xmm1
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  %xmm0,%xmm1
  mov    -0x40(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm2
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movss  0x4(%rax),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x4(%rbp)
  pxor   %xmm1,%xmm1
  cvtss2sd -0x8(%rbp),%xmm1
  movsd  D94(%rip),%xmm0
  comisd %xmm1,%xmm0
  jbe    L75
  pxor   %xmm1,%xmm1
  cvtss2sd -0x4(%rbp),%xmm1
  movsd  D94(%rip),%xmm0
  comisd %xmm1,%xmm0
  jbe    L148
  mov    $0x0,%eax
  jmp    L268
L148:
  mov    -0x40(%rbp),%rax
  movss  (%rax),%xmm0
  mov    -0x38(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0x38(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    -0x40(%rbp),%rax
  movss  0x4(%rax),%xmm0
  movss  %xmm0,(%rdx)
  jmp    L248
L75:
  pxor   %xmm1,%xmm1
  cvtss2sd -0x4(%rbp),%xmm1
  movsd  D94(%rip),%xmm0
  comisd %xmm1,%xmm0
  jbe    L248
  mov    -0x38(%rbp),%rax
  movss  (%rax),%xmm0
  mov    -0x40(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0x40(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    -0x38(%rbp),%rax
  movss  0x4(%rax),%xmm0
  movss  %xmm0,(%rdx)
L248:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x10(%rbp)
L200:
  mov    -0x10(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jne    L288
L263:
  mov    $0x1,%eax
L268:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D180
type_guessed: byte[8]
name: parse_data
arguments: data_tag: D139
type_guessed: byte[4]
name: parse_data
arguments: data_tag: D8
type_guessed: byte[16]
name: parse_data
arguments: data_tag: D94
type_guessed: byte[8]

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

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

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

tool: {"D94": [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);
}
```