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

```asm
<quarticgrad>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    -0x28(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  movsd  D24(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  mov    -0x28(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  movapd %xmm0,%xmm2
  addsd  %xmm0,%xmm2
  subsd  %xmm2,%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x28(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x20(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm1
  movsd  -0x8(%rbp),%xmm2
  movsd  D55(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  mulsd  -0x8(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x38(%rbp),%rax
  movsd  %xmm0,(%rax)
  movsd  -0x20(%rbp),%xmm1
  movsd  D61(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x10(%rbp),%xmm2
  movsd  D5(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  mulsd  -0x10(%rbp),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  mov    -0x38(%rbp),%rax
  add    $0x8,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x18(%rbp),%xmm1
  movsd  D24(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x10(%rbp),%xmm2
  movsd  D64(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  mulsd  -0x10(%rbp),%xmm1
  mulsd  -0x10(%rbp),%xmm1
  mov    -0x38(%rbp),%rax
  add    $0x10,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x18(%rbp),%xmm1
  movsd  D18(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x8(%rbp),%xmm2
  movsd  D55(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  mulsd  -0x8(%rbp),%xmm1
  mulsd  -0x8(%rbp),%xmm1
  mov    -0x38(%rbp),%rax
  add    $0x18,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  nop
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D24
type_infered: byte[8]
name: disassemble_data
arguments: tag: D55
type_infered: byte[8]
name: disassemble_data
arguments: tag: D61
type_infered: byte[8]
name: disassemble_data
arguments: tag: D5
type_infered: byte[8]
name: disassemble_data
arguments: tag: D64
type_infered: byte[8]
name: disassemble_data
arguments: tag: D18
type_infered: byte[8]

tool: {"D24": [0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x40]}

tool: {"D55": [0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x40]}

tool: {"D61": [0x00,0x00,0x00,0x00,0x00,0x00,0x34,0x40]}

tool: {"D5": [0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x40]}

tool: {"D64": [0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x40]}

tool: {"D18": [0x00,0x00,0x00,0x00,0x00,0x00,0x24,0xc0]}

assistant: ```c
void quarticgrad(double *x, int N, double *g, void *params) {
  double t1, t2, t3, t4;
  t1 = (x[0] + 10 * x[1]);
  t2 = (x[2] - x[3]);
  t3 = (x[1] - 2 * x[2]);
  t4 = (x[0] - x[3]);
  g[0] = 2 * t1 + 40 * t4 * t4 * t4;
  g[1] = 20 * t1 + 4 * t3 * t3 * t3;
  g[2] = 10 * t2 - 8 * t3 * t3 * t3;
  g[3] = -10 * t2 - 40 * t4 * t4 * t4;
}
```