user: Translate the below assembly code into C programming language:

```asm
<trackball>:
  endbr64
  push   %r15
  mov    $0x0,%edx
  movaps %xmm2,%xmm5
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x60,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  ucomiss %xmm3,%xmm1
  setnp  %al
  cmovne %edx,%eax
  test   %al,%al
  je     L51
  ucomiss %xmm2,%xmm0
  setnp  %al
  cmovne %edx,%eax
  test   %al,%al
  jne    L44
L51:
  movsd  D40(%rip),%xmm7
  pxor   %xmm4,%xmm4
  pxor   %xmm6,%xmm6
  mov    $0x3,%eax
  cvtss2sd %xmm1,%xmm4
  cvtss2sd %xmm0,%xmm6
  movapd %xmm4,%xmm2
  movapd %xmm6,%xmm1
  movapd %xmm7,%xmm0
  movss  %xmm3,0x1c(%rsp)
  lea    0x34(%rsp),%r12
  lea    0x40(%rsp),%r13
  movss  %xmm5,0x18(%rsp)
  lea    0x28(%rsp),%r14
  lea    0x4c(%rsp),%r15
  movsd  %xmm4,0x10(%rsp)
  movsd  %xmm6,0x8(%rsp)
  call   <tb_project_to_sphere@plt>
  pxor   %xmm2,%xmm2
  movsd  0x10(%rsp),%xmm4
  mov    %r12,%rdi
  cvtsi2ss %eax,%xmm2
  movsd  0x8(%rsp),%xmm6
  mov    $0x3,%eax
  movapd %xmm4,%xmm1
  movapd %xmm6,%xmm0
  cvtss2sd %xmm2,%xmm2
  call   <vset@plt>
  mov    D40(%rip),%rax
  movss  0x1c(%rsp),%xmm3
  movss  0x18(%rsp),%xmm5
  cvtss2sd %xmm3,%xmm3
  movq   %rax,%xmm0
  movapd %xmm3,%xmm2
  mov    $0x3,%eax
  cvtss2sd %xmm5,%xmm5
  movapd %xmm5,%xmm1
  movsd  %xmm3,0x10(%rsp)
  movsd  %xmm5,0x8(%rsp)
  call   <tb_project_to_sphere@plt>
  pxor   %xmm2,%xmm2
  movsd  0x10(%rsp),%xmm3
  mov    %r13,%rdi
  cvtsi2ss %eax,%xmm2
  movsd  0x8(%rsp),%xmm5
  mov    $0x3,%eax
  movapd %xmm3,%xmm1
  movapd %xmm5,%xmm0
  cvtss2sd %xmm2,%xmm2
  call   <vset@plt>
  mov    %r14,%rdx
  mov    %r12,%rsi
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <vcross@plt>
  mov    %r15,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <vsub@plt>
  xor    %eax,%eax
  mov    %r15,%rdi
  call   <vlength@plt>
  pxor   %xmm0,%xmm0
  movsd  D4(%rip),%xmm1
  cvtsi2ss %eax,%xmm0
  cvtss2sd %xmm0,%xmm0
  divsd  D30(%rip),%xmm0
  cvtsd2ss %xmm0,%xmm0
  comiss D1(%rip),%xmm0
  jbe    L29
L1:
  movapd %xmm1,%xmm0
  call   <asin@plt>
  mov    %rbp,%rsi
  mov    %r14,%rdi
  mov    $0x1,%eax
  addsd  %xmm0,%xmm0
  cvtsd2ss %xmm0,%xmm0
  cvtss2sd %xmm0,%xmm0
  call   <axis_to_quat@plt>
L65:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L16
  add    $0x60,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L29:
  movss  D12(%rip),%xmm1
  comiss %xmm0,%xmm1
  jbe    L39
  movsd  D66(%rip),%xmm1
  jmp    L1
  nop
L44:
  xor    %eax,%eax
  call   <vzero@plt>
  movl   $0x3f800000,0xc(%rbp)
  jmp    L65
L16:
  call   <__stack_chk_fail@plt>
L39:
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  jmp    L1
```

tool_calls: name: disassemble_data
arguments: data_tag: D40
type: byte[8]
name: disassemble_data
arguments: data_tag: D4
type: f64
name: disassemble_data
arguments: data_tag: D30
type: byte[8]
name: disassemble_data
arguments: data_tag: D1
type: byte[4]
name: disassemble_data
arguments: data_tag: D12
type: byte[4]
name: disassemble_data
arguments: data_tag: D66
type: byte[8]

tool: {"D40": [0x00,0x00,0x00,0xa0,0x99,0x99,0xe9,0x3f]}

tool: D4: 1

tool: {"D30": [0x9a,0x99,0x99,0x99,0x99,0x99,0xf9,0x3f]}

tool: {"D1": [0x00,0x00,0x80,0x3f]}

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

tool: {"D66": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

assistant: ```c
void trackball(float *q, float p1x, float p1y, float p2x, float p2y) {
  float a[3l];
  float phi;
  float p1[3l];
  float p2[3l];
  float d[3l];
  float t;
  if ((p1x == p2x)) {
    if ((p1y == p2y)) {
      vzero(q);
      q[(signed long int)3] = (float)1.000000;
      return;
    }
  }
  float return_value_tb_project_to_sphere$1;
  return_value_tb_project_to_sphere$1 = tb_project_to_sphere((float)8.000000e-1, p1x, p1y);
  vset(p1, p1x, p1y, return_value_tb_project_to_sphere$1);
  float return_value_tb_project_to_sphere$2;
  return_value_tb_project_to_sphere$2 = tb_project_to_sphere((float)8.000000e-1, p2x, p2y);
  vset(p2, p2x, p2y, return_value_tb_project_to_sphere$2);
  vcross(p2, p1, a);
  vsub(p1, p2, d);
  float return_value_vlength$3;
  return_value_vlength$3 = vlength(d);
  t = (float)((double)return_value_vlength$3 / (2.000000 * 8.000000e-1));
  if (t > 1.000000f)
    t = (float)1.000000;
  if (t < -1.000000f)
    t = (float)-1.000000;
  double return_value_asin$4;
  return_value_asin$4 = asin((double)t);
  phi = (float)(2.000000 * return_value_asin$4);
  axis_to_quat(a, phi, q);
}
```