user: 请将以下的汇编代码转换成C语言代码：

```asm
<all_HoriR_valid>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    0xc(%rsi),%eax
  mov    %fs:0x28,%rcx
  mov    %rcx,0x48(%rsp)
  mov    (%rsi),%ecx
  lea    0x10(%rsp),%r15
  lea    0x30(%rsp),%r14
  lea    (%rax,%rax,2),%eax
  add    %eax,%eax
  cltq
  lea    (%rdi,%rax,8),%rbp
  lea    (%rcx,%rcx,2),%ecx
  add    %ecx,%ecx
  movslq %ecx,%rcx
  lea    (%rdi,%rcx,8),%r12
  mov    0x4(%rsi),%ecx
  lea    (%rcx,%rcx,2),%ecx
  add    %ecx,%ecx
  movslq %ecx,%rcx
  lea    (%rdi,%rcx,8),%r13
  mov    0x8(%rsi),%ecx
  mov    %r12,%rsi
  mov    %r13,%rdx
  lea    (%rcx,%rcx,2),%ecx
  add    %ecx,%ecx
  movslq %ecx,%rcx
  lea    (%rdi,%rcx,8),%rbx
  mov    $0x1,%ecx
  mov    %r15,%rdi
  call   <crossprod_st@plt>
  lea    0x18(%r13),%rdx
  lea    0x18(%r12),%rsi
  mov    %r14,%rdi
  mov    $0x1,%ecx
  call   <crossprod_st@plt>
  movsd  0x10(%rsp),%xmm0
  movsd  0x18(%rsp),%xmm7
  movsd  (%rbx),%xmm1
  movsd  0x8(%rbx),%xmm3
  movsd  0x20(%rsp),%xmm6
  movsd  0x30(%rsp),%xmm2
  mulsd  %xmm7,%xmm3
  movsd  0x38(%rsp),%xmm5
  movsd  0x20(%rbx),%xmm8
  mulsd  %xmm0,%xmm1
  movsd  0x40(%rsp),%xmm4
  mulsd  %xmm5,%xmm8
  mulsd  0x0(%rbp),%xmm0
  mulsd  0x8(%rbp),%xmm7
  mulsd  0x20(%rbp),%xmm5
  addsd  %xmm3,%xmm1
  movsd  0x10(%rbx),%xmm3
  mulsd  %xmm6,%xmm3
  mulsd  0x10(%rbp),%xmm6
  addsd  %xmm7,%xmm0
  addsd  %xmm3,%xmm1
  movsd  0x18(%rbx),%xmm3
  addsd  %xmm6,%xmm0
  mulsd  %xmm2,%xmm3
  mulsd  0x18(%rbp),%xmm2
  addsd  %xmm8,%xmm3
  movsd  0x28(%rbx),%xmm8
  addsd  %xmm5,%xmm2
  pxor   %xmm5,%xmm5
  mulsd  %xmm4,%xmm8
  mulsd  0x28(%rbp),%xmm4
  addsd  %xmm8,%xmm3
  addsd  %xmm4,%xmm2
  mulsd  %xmm3,%xmm1
  mulsd  %xmm1,%xmm0
  mulsd  %xmm2,%xmm0
  comisd %xmm0,%xmm5
  ja     L33
  mov    $0x1,%ecx
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %r15,%rdi
  movsd  %xmm1,0x8(%rsp)
  call   <crossprod_st@plt>
  lea    0x18(%rbp),%rdx
  lea    0x18(%rbx),%rsi
  mov    %r14,%rdi
  mov    $0x1,%ecx
  call   <crossprod_st@plt>
  movsd  0x10(%rsp),%xmm0
  movsd  0x18(%rsp),%xmm8
  movsd  (%r12),%xmm2
  movsd  0x8(%r12),%xmm4
  movsd  0x20(%rsp),%xmm7
  movsd  0x30(%rsp),%xmm3
  mulsd  %xmm0,%xmm2
  movsd  0x38(%rsp),%xmm6
  movsd  0x20(%r12),%xmm9
  mulsd  %xmm8,%xmm4
  movsd  0x40(%rsp),%xmm5
  movsd  0x8(%rsp),%xmm1
  mulsd  %xmm6,%xmm9
  addsd  %xmm4,%xmm2
  movsd  0x10(%r12),%xmm4
  mulsd  %xmm7,%xmm4
  addsd  %xmm4,%xmm2
  movsd  0x18(%r12),%xmm4
  mulsd  %xmm3,%xmm4
  mulsd  %xmm1,%xmm2
  addsd  %xmm9,%xmm4
  movsd  0x28(%r12),%xmm9
  mulsd  %xmm5,%xmm9
  addsd  %xmm9,%xmm4
  mulsd  %xmm4,%xmm2
  pxor   %xmm4,%xmm4
  comisd %xmm2,%xmm4
  ja     L33
  mulsd  0x0(%r13),%xmm0
  xor    %eax,%eax
  mulsd  0x8(%r13),%xmm8
  mulsd  0x10(%r13),%xmm7
  mulsd  0x18(%r13),%xmm3
  mulsd  0x20(%r13),%xmm6
  mulsd  0x28(%r13),%xmm5
  addsd  %xmm8,%xmm0
  addsd  %xmm7,%xmm0
  addsd  %xmm6,%xmm3
  mulsd  %xmm1,%xmm0
  addsd  %xmm5,%xmm3
  mulsd  %xmm3,%xmm0
  comisd %xmm0,%xmm4
  setbe  %al
  jmp    L14
  nopl   (%rax)
L33:
  xor    %eax,%eax
L14:
  mov    0x48(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L12
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L12:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int all_HoriR_valid(double *us, int *idx) {
  double p[3], q[3];
  double *a, *b, *c, *d, ori;
  a = us + 6 * idx[0];
  b = us + 6 * idx[1];
  c = us + 6 * idx[2];
  d = us + 6 * idx[3];
  crossprod_st(p, a, b, 1);
  crossprod_st(q, a + 3, b + 3, 1);
  ori = (p[0] * c[0] + p[1] * c[1] + p[2] * c[2]) * (q[0] * c[3] + q[1] * c[4] + q[2] * c[5]);
  if (ori * (p[0] * d[0] + p[1] * d[1] + p[2] * d[2]) * (q[0] * d[3] + q[1] * d[4] + q[2] * d[5]) < 0)
    return 0;
  crossprod_st(p, c, d, 1);
  crossprod_st(q, c + 3, d + 3, 1);
  if (ori * (p[0] * a[0] + p[1] * a[1] + p[2] * a[2]) * (q[0] * a[3] + q[1] * a[4] + q[2] * a[5]) < 0)
    return 0;
  if (ori * (p[0] * b[0] + p[1] * b[1] + p[2] * b[2]) * (q[0] * b[3] + q[1] * b[4] + q[2] * b[5]) < 0)
    return 0;
  return 1;
}
```