user: Please show me the C implementation that matches the assembly code listed below:

```asm
<solve_quartic_2>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x40,%rsp
  movaps %xmm0,%xmm7
  movss  %xmm0,0x4(%rsp)
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  movaps %xmm0,%xmm4
  mulss  %xmm0,%xmm4
  movaps %xmm4,%xmm0
  mulss  D39(%rip),%xmm0
  movss  D66(%rip),%xmm5
  mulss  %xmm5,%xmm0
  movaps %xmm1,%xmm8
  subss  %xmm0,%xmm8
  movss  %xmm8,(%rsp)
  movaps %xmm7,%xmm0
  mulss  %xmm4,%xmm0
  mulss  %xmm0,%xmm5
  movaps %xmm7,%xmm6
  mulss  %xmm1,%xmm6
  mulss  D139(%rip),%xmm6
  subss  %xmm6,%xmm5
  addss  %xmm2,%xmm5
  mulss  %xmm7,%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  D117(%rip),%xmm0
  mulss  %xmm1,%xmm4
  mulss  D62(%rip),%xmm4
  cvtss2sd %xmm4,%xmm4
  addsd  %xmm4,%xmm0
  mulss  %xmm7,%xmm2
  mulss  D160(%rip),%xmm2
  cvtss2sd %xmm2,%xmm2
  subsd  %xmm2,%xmm0
  cvtss2sd %xmm3,%xmm3
  addsd  %xmm3,%xmm0
  pxor   %xmm1,%xmm1
  cvtsd2ss %xmm0,%xmm1
  ucomiss D136(%rip),%xmm5
  jp     L49
  jne    L49
  lea    0x20(%rsp),%rsi
  movaps %xmm8,%xmm0
  mov    $0x1,%edi
  call   <solve_quadratic_2@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  je     L17
  cmp    $0x2,%eax
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movss  0x20(%rsp),%xmm0
  mov    $0x0,%ebp
  comiss D136(%rip),%xmm0
  jae    L69
L66:
  movss  0x24(%rsp),%xmm0
  comiss D136(%rip),%xmm0
  jb     L17
  call   <sqrt@plt>
  movss  0x4(%rsp),%xmm1
  mulss  D160(%rip),%xmm1
  movslq %ebp,%rax
  movaps %xmm0,%xmm2
  subss  %xmm1,%xmm2
  movss  %xmm2,(%rbx,%rax,4)
  xorps  D83(%rip),%xmm0
  subss  %xmm1,%xmm0
  movss  %xmm0,0x4(%rbx,%rax,4)
  add    $0x2,%ebp
  jmp    L17
L69:
  call   <sqrt@plt>
  movss  0x4(%rsp),%xmm1
  mulss  D160(%rip),%xmm1
  movaps %xmm0,%xmm2
  subss  %xmm1,%xmm2
  movss  %xmm2,(%rbx)
  xorps  D83(%rip),%xmm0
  subss  %xmm1,%xmm0
  movss  %xmm0,0x4(%rbx)
  mov    $0x2,%ebp
  jmp    L66
L49:
  movaps %xmm5,%xmm6
  xorps  D83(%rip),%xmm6
  lea    0x20(%rsp),%rsi
  movss  (%rsp),%xmm3
  movaps %xmm3,%xmm0
  mulss  %xmm3,%xmm0
  mulss  D173(%rip),%xmm1
  subss  %xmm1,%xmm0
  movaps %xmm3,%xmm1
  addss  %xmm3,%xmm1
  cvttss2si %xmm1,%edi
  movss  %xmm6,0x8(%rsp)
  mulss  %xmm6,%xmm5
  movaps %xmm5,%xmm1
  call   <solve_cubic@plt>
  mov    0x20(%rsp),%ebp
  movd   %ebp,%xmm0
  call   <sqrt@plt>
  movaps %xmm0,%xmm2
  movss  0x8(%rsp),%xmm6
  divss  %xmm0,%xmm6
  movd   %ebp,%xmm5
  addss  (%rsp),%xmm5
  movss  D153(%rip),%xmm0
  movss  %xmm0,0x10(%rsp)
  movss  %xmm0,0x14(%rsp)
  movss  %xmm0,0x18(%rsp)
  movss  %xmm0,0x1c(%rsp)
  lea    0x10(%rsp),%rsi
  movss  %xmm5,(%rsp)
  movaps %xmm5,%xmm1
  movss  %xmm6,0xc(%rsp)
  addss  %xmm6,%xmm1
  mulss  D139(%rip),%xmm1
  movss  %xmm2,0x8(%rsp)
  movaps %xmm2,%xmm0
  mov    $0x1,%edi
  call   <solve_quadratic_2@plt>
  mov    %eax,%r12d
  lea    0x18(%rsp),%rsi
  movss  (%rsp),%xmm1
  subss  0xc(%rsp),%xmm1
  movss  0x8(%rsp),%xmm0
  xorps  D83(%rip),%xmm0
  mulss  D139(%rip),%xmm1
  mov    $0x1,%edi
  call   <solve_quadratic_2@plt>
  mov    %eax,%ebp
  movss  0x4(%rsp),%xmm0
  mulss  D160(%rip),%xmm0
  movss  0x10(%rsp),%xmm1
  subss  %xmm0,%xmm1
  movss  %xmm1,(%rbx)
  movss  0x14(%rsp),%xmm1
  subss  %xmm0,%xmm1
  movss  %xmm1,0x4(%rbx)
  movslq %r12d,%rax
  movss  0x18(%rsp),%xmm1
  subss  %xmm0,%xmm1
  movss  %xmm1,(%rbx,%rax,4)
  movss  0x1c(%rsp),%xmm1
  subss  %xmm0,%xmm1
  movss  %xmm1,0x4(%rbx,%rax,4)
  add    %r12d,%ebp
L17:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L16
  mov    %ebp,%eax
  add    $0x40,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L16:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D39
datatype: f32
name: read_data
arguments: data_tag: D66
datatype: byte[4]
name: read_data
arguments: data_tag: D139
datatype: byte[4]
name: read_data
arguments: data_tag: D117
datatype: f32[2]
name: read_data
arguments: data_tag: D62
datatype: byte[4]
name: read_data
arguments: data_tag: D160
datatype: byte[4]
name: read_data
arguments: data_tag: D136
datatype: f32
name: read_data
arguments: data_tag: D83
datatype: byte[16]
name: read_data
arguments: data_tag: D173
datatype: f32
name: read_data
arguments: data_tag: D153
datatype: byte[4]

tool: D39: 3

tool: {"D66": [0x00,0x00,0x00,0x3e]}

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

tool: {"D117": [0.0,-1.0625]}

tool: {"D62": [0x00,0x00,0x80,0x3d]}

tool: {"D160": [0x00,0x00,0x80,0x3e]}

tool: D136: 0

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

tool: D173: 4

tool: {"D153": [0x00,0x00,0x80,0xbf]}

assistant: ```c
int solve_quartic_2(float p, float q, float r, float s, float t[4]) {
  float a = q - p * p * 3 / 8;
  float b = p * p * p / 8 - p * q / 2 + r;
  float c = p * p * p * p * (-3.0 / 256.0) + p * p * q / 16 - p * r / 4 + s;
  if (b == 0.0) {
    float z[2];
    int count = solve_quadratic_2(1, a, c, z);
    if (count == 0)
      return 0;
    assert(count == 2);
    int solutions = 0;
    if (z[0] >= 0) {
      float x1 = sqrt(z[0]);
      float x2 = -x1;
      t[0] = x1 - p / 4;
      t[1] = x2 - p / 4;
      solutions += 2;
    }
    if (z[1] >= 0) {
      float x1 = sqrt(z[1]);
      float x2 = -x1;
      t[solutions + 0] = x1 - p / 4;
      t[solutions + 1] = x2 - p / 4;
      solutions += 2;
    }
    return solutions;
  }
  float t3[4];
  solve_cubic(2 * a, a * a - 4 * c, -b * b, t3);
  float z = t3[0];
  float alpha = sqrt(z);
  float rho = -b / alpha;
  float beta = (a + z + rho) / 2;
  float delta = (a + z - rho) / 2;
  float t1[2] = {-1, -1}, t2[2] = {-1, -1};
  int n1 = solve_quadratic_2(1, alpha, beta, t1);
  int n2 = solve_quadratic_2(1, -alpha, delta, t2);
  t[0] = t1[0] - p / 4;
  t[1] = t1[1] - p / 4;
  t[n1 + 0] = t2[0] - p / 4;
  t[n1 + 1] = t2[1] - p / 4;
  return n1 + n2;
}
```