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

```asm
<F_edgeBlendTriDrv>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  movsd  (%rax),%xmm0
  mov    -0x28(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x20(%rbp),%rax
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L89
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  je     L72
L89:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jne    L65
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L65
L72:
  movsd  -0x8(%rbp),%xmm1
  movsd  D23(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x28(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movsd  -0x10(%rbp),%xmm1
  movsd  D23(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  jmp    L84
L65:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jne    L22
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  cmp    $0x2,%eax
  je     L47
L22:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x2,%eax
  jne    L155
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jne    L155
L47:
  movsd  -0x8(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  mov    -0x28(%rbp),%rax
  movsd  %xmm0,(%rax)
  movsd  -0x10(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  movsd  D4(%rip),%xmm2
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  movsd  -0x8(%rbp),%xmm2
  movsd  D19(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  jmp    L84
L155:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x2,%eax
  jne    L41
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L117
L41:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L60
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  cmp    $0x2,%eax
  jne    L60
L117:
  movsd  -0x10(%rbp),%xmm1
  movsd  D19(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  D4(%rip),%xmm2
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  movsd  -0x8(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x28(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movsd  -0x10(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  jmp    L84
L60:
  mov    $0x0,%eax
  jmp    L141
L84:
  mov    $0x1,%eax
L141:
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D23
type_infered: f32[2]
name: unpack_data
arguments: data_label: D4
type_infered: f64
name: unpack_data
arguments: data_label: D19
type_infered: f64

tool: {"D23": [0.0,-2.0]}

tool: D4: 2

tool: D19: 4

assistant: ```c
int F_edgeBlendTriDrv(int index[2], double *L, double drv[]) {
  double r, s;
  drv[0] = drv[1] = 0.0;
  r = L[0];
  s = L[1];
  if ((index[0] == 0 && index[1] == 1) || (index[0] == 1 && index[1] == 0)) {
    drv[0] = -2.0 * s;
    drv[1] = -2.0 * r;
  } else if ((index[0] == 1 && index[1] == 2) || (index[0] == 2 && index[1] == 1)) {
    drv[0] = 2.0 * s;
    drv[1] = -2.0 + 2.0 * r + 4.0 * s;
  } else if ((index[0] == 2 && index[1] == 0) || (index[0] == 0 && index[1] == 2)) {
    drv[0] = 4.0 * r - 2.0 + 2.0 * s;
    drv[1] = 2.0 * r;
  } else
    return 0;
  return 1;
}
```