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

```asm
<bpstep_par>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x158,%rsp
  mov    %rdi,-0x128(%rbp)
  mov    %rsi,-0x130(%rbp)
  mov    %rdx,-0x138(%rbp)
  mov    %rcx,-0x140(%rbp)
  mov    %r8,-0x148(%rbp)
  mov    %r9,-0x150(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0x158(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movq   $0x1,-0x118(%rbp)
  jmp    L94
L191:
  mov    -0x118(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x128(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movsd  0x18(%rax),%xmm0
  mov    -0x118(%rbp),%rax
  movsd  %xmm0,-0x60(%rbp,%rax,8)
  mov    -0x118(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x138(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movsd  0x18(%rax),%xmm0
  mov    -0x118(%rbp),%rax
  movsd  %xmm0,-0x40(%rbp,%rax,8)
  addq   $0x1,-0x118(%rbp)
L94:
  cmpq   $0x3,-0x118(%rbp)
  jle    L191
  lea    -0xe0(%rbp),%rdx
  lea    -0x40(%rbp),%rcx
  lea    -0x60(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <cross@plt>
  lea    -0x40(%rbp),%rdx
  lea    -0x60(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <magang@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x108(%rbp)
  mov    $0x3,%ecx
  mov    $0x1,%edx
  mov    $0x3,%esi
  mov    $0x1,%edi
  call   <dmatrix@plt>
  mov    %rax,-0x100(%rbp)
  mov    $0x3,%ecx
  mov    $0x1,%edx
  mov    $0x3,%esi
  mov    $0x1,%edi
  call   <dmatrix@plt>
  mov    %rax,-0xf8(%rbp)
  mov    $0x3,%ecx
  mov    $0x1,%edx
  mov    $0x3,%esi
  mov    $0x1,%edi
  call   <dmatrix@plt>
  mov    %rax,-0xf0(%rbp)
  movsd  -0x108(%rbp),%xmm1
  movsd  D15(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movq   %xmm1,%rdx
  mov    -0xf0(%rbp),%rcx
  lea    -0xe0(%rbp),%rax
  mov    %rcx,%rsi
  movq   %rdx,%xmm0
  mov    %rax,%rdi
  call   <arb_rotation@plt>
  mov    -0x138(%rbp),%rdx
  mov    -0xf0(%rbp),%rax
  sub    $0x8,%rsp
  push   -0xf8(%rbp)
  mov    $0x3,%r9d
  mov    $0x3,%r8d
  mov    %rdx,%rcx
  mov    $0x3,%edx
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <multi_matrix@plt>
  add    $0x10,%rsp
  movsd  -0x108(%rbp),%xmm1
  movsd  D6(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movq   %xmm1,%rdx
  mov    -0xf0(%rbp),%rcx
  lea    -0xe0(%rbp),%rax
  mov    %rcx,%rsi
  movq   %rdx,%xmm0
  mov    %rax,%rdi
  call   <arb_rotation@plt>
  mov    -0x128(%rbp),%rdx
  mov    -0xf0(%rbp),%rax
  sub    $0x8,%rsp
  push   -0x100(%rbp)
  mov    $0x3,%r9d
  mov    $0x3,%r8d
  mov    %rdx,%rcx
  mov    $0x3,%edx
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <multi_matrix@plt>
  add    $0x10,%rsp
  movq   $0x1,-0x118(%rbp)
  jmp    L39
L23:
  mov    -0x118(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0xf8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movsd  0x18(%rax),%xmm0
  mov    -0x118(%rbp),%rax
  movsd  %xmm0,-0x80(%rbp,%rax,8)
  mov    -0x118(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x100(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movsd  0x10(%rax),%xmm0
  mov    -0x118(%rbp),%rax
  movsd  %xmm0,-0x60(%rbp,%rax,8)
  mov    -0x118(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0xf8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movsd  0x10(%rax),%xmm0
  mov    -0x118(%rbp),%rax
  movsd  %xmm0,-0x40(%rbp,%rax,8)
  addq   $0x1,-0x118(%rbp)
L39:
  cmpq   $0x3,-0x118(%rbp)
  jle    L23
  mov    -0x148(%rbp),%rax
  lea    0x30(%rax),%rbx
  lea    -0x80(%rbp),%rdx
  lea    -0x40(%rbp),%rcx
  lea    -0x60(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <vec_ang@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  mov    -0x148(%rbp),%rax
  add    $0x30,%rax
  mov    (%rax),%rax
  mov    $0xb4,%edi
  movq   %rax,%xmm0
  call   <ddiff@plt>
  movsd  D46(%rip),%xmm1
  comisd %xmm0,%xmm1
  jbe    L201
  movq   $0x1,-0x118(%rbp)
  jmp    L10
L50:
  mov    -0x118(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0xf8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movsd  0x8(%rax),%xmm0
  mov    -0x118(%rbp),%rax
  movsd  %xmm0,-0xa0(%rbp,%rax,8)
  addq   $0x1,-0x118(%rbp)
L10:
  cmpq   $0x3,-0x118(%rbp)
  jle    L50
  jmp    L2
L201:
  mov    -0x148(%rbp),%rax
  add    $0x30,%rax
  mov    (%rax),%rax
  mov    $0xffffff4c,%edi
  movq   %rax,%xmm0
  call   <ddiff@plt>
  movsd  D46(%rip),%xmm1
  comisd %xmm0,%xmm1
  jbe    L177
  movq   $0x1,-0x118(%rbp)
  jmp    L9
L22:
  mov    -0x118(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0xf8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  movq   D40(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  mov    -0x118(%rbp),%rax
  movsd  %xmm0,-0xa0(%rbp,%rax,8)
  addq   $0x1,-0x118(%rbp)
L9:
  cmpq   $0x3,-0x118(%rbp)
  jle    L22
  jmp    L2
L177:
  movq   $0x1,-0x118(%rbp)
  jmp    L18
L111:
  mov    -0x118(%rbp),%rax
  movsd  -0x60(%rbp,%rax,8),%xmm1
  mov    -0x118(%rbp),%rax
  movsd  -0x40(%rbp,%rax,8),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x118(%rbp),%rax
  movsd  %xmm0,-0xa0(%rbp,%rax,8)
  addq   $0x1,-0x118(%rbp)
L18:
  cmpq   $0x3,-0x118(%rbp)
  jle    L111
  lea    -0xa0(%rbp),%rax
  mov    %rax,%rdi
  call   <vec_norm@plt>
L2:
  lea    -0xc0(%rbp),%rdx
  lea    -0x80(%rbp),%rcx
  lea    -0xa0(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <cross@plt>
  movq   $0x1,-0x118(%rbp)
  jmp    L145
L197:
  mov    -0x118(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x130(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x118(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x140(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x118(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x158(%rbp),%rax
  add    %rdx,%rax
  movsd  D6(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x118(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x140(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x118(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x130(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x118(%rbp),%rax
  movsd  %xmm0,-0x60(%rbp,%rax,8)
  mov    -0x118(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x150(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    0x8(%rax),%rdx
  mov    -0x118(%rbp),%rax
  movsd  -0xc0(%rbp,%rax,8),%xmm0
  movsd  %xmm0,(%rdx)
  mov    -0x118(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x150(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    0x10(%rax),%rdx
  mov    -0x118(%rbp),%rax
  movsd  -0xa0(%rbp,%rax,8),%xmm0
  movsd  %xmm0,(%rdx)
  mov    -0x118(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x150(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    0x18(%rax),%rdx
  mov    -0x118(%rbp),%rax
  movsd  -0x80(%rbp,%rax,8),%xmm0
  movsd  %xmm0,(%rdx)
  addq   $0x1,-0x118(%rbp)
L145:
  cmpq   $0x3,-0x118(%rbp)
  jle    L197
  movq   $0x1,-0x118(%rbp)
  jmp    L48
L202:
  mov    -0x118(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x148(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  movq   $0x1,-0x110(%rbp)
  jmp    L156
L149:
  mov    -0x118(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x148(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x110(%rbp),%rax
  movsd  -0x60(%rbp,%rax,8),%xmm2
  mov    -0x110(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x150(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x118(%rbp),%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0x118(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x148(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x110(%rbp)
L156:
  cmpq   $0x3,-0x110(%rbp)
  jle    L149
  addq   $0x1,-0x118(%rbp)
L48:
  cmpq   $0x3,-0x118(%rbp)
  jle    L202
  lea    -0x80(%rbp),%rdx
  lea    -0xa0(%rbp),%rcx
  lea    -0xe0(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <vec_ang@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <deg2rad@plt>
  movq   %xmm0,%rax
  mov    %rax,-0xe8(%rbp)
  mov    -0xe8(%rbp),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  movq   %xmm0,%rax
  mov    -0x148(%rbp),%rdx
  add    $0x28,%rdx
  movq   %rax,%xmm0
  mulsd  -0x108(%rbp),%xmm0
  movsd  %xmm0,(%rdx)
  mov    -0xe8(%rbp),%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  movq   %xmm0,%rax
  mov    -0x148(%rbp),%rdx
  add    $0x20,%rdx
  movq   %rax,%xmm0
  mulsd  -0x108(%rbp),%xmm0
  movsd  %xmm0,(%rdx)
  mov    -0x100(%rbp),%rax
  mov    $0x3,%r8d
  mov    $0x1,%ecx
  mov    $0x3,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <free_dmatrix@plt>
  mov    -0xf8(%rbp),%rax
  mov    $0x3,%r8d
  mov    $0x1,%ecx
  mov    $0x3,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <free_dmatrix@plt>
  mov    -0xf0(%rbp),%rax
  mov    $0x3,%r8d
  mov    $0x1,%ecx
  mov    $0x3,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <free_dmatrix@plt>
  nop
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L55
  call   <__stack_chk_fail@plt>
L55:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D15
data_type: f32[2]
name: retrieve_data
arguments: data_tag: D6
data_type: f64
name: retrieve_data
arguments: data_tag: D46
data_type: byte[8]
name: retrieve_data
arguments: data_tag: D40
data_type: f32[2]

tool: {"D15": [0.0,-1.75]}

tool: D6: 0.5

tool: {"D46": [0x48,0xaf,0xbc,0x9a,0xf2,0xd7,0x7a,0x3e]}

tool: {"D40": [0.0,-0.0]}

assistant: ```c
void bpstep_par(double **rot1, double *org1, double **rot2, double *org2, double *pars, double **mst_orien, double *mst_org) {
  double phi, rolltilt;
  double hinge[4], mstx[4], msty[4], mstz[4], t1[4], t2[4];
  double **para_bp1, **para_bp2, **temp;
  long i, j;
  for (i = 1; i <= 3; i++) {
    t1[i] = rot1[i][3];
    t2[i] = rot2[i][3];
  }
  cross(t1, t2, hinge);
  rolltilt = magang(t1, t2);
  para_bp1 = dmatrix(1, 3, 1, 3);
  para_bp2 = dmatrix(1, 3, 1, 3);
  temp = dmatrix(1, 3, 1, 3);
  arb_rotation(hinge, -0.5 * rolltilt, temp);
  multi_matrix(temp, 3, 3, rot2, 3, 3, para_bp2);
  arb_rotation(hinge, 0.5 * rolltilt, temp);
  multi_matrix(temp, 3, 3, rot1, 3, 3, para_bp1);
  for (i = 1; i <= 3; i++) {
    mstz[i] = para_bp2[i][3];
    t1[i] = para_bp1[i][2];
    t2[i] = para_bp2[i][2];
  }
  pars[6] = vec_ang(t1, t2, mstz);
  if (ddiff(pars[6], 180) < 1.0e-7)
    for (i = 1; i <= 3; i++)
      msty[i] = para_bp2[i][1];
  else if (ddiff(pars[6], -180) < 1.0e-7)
    for (i = 1; i <= 3; i++)
      msty[i] = -para_bp2[i][1];
  else {
    for (i = 1; i <= 3; i++)
      msty[i] = t1[i] + t2[i];
    vec_norm(msty);
  }
  cross(msty, mstz, mstx);
  for (i = 1; i <= 3; i++) {
    mst_org[i] = 0.5 * (org1[i] + org2[i]);
    t1[i] = org2[i] - org1[i];
    mst_orien[i][1] = mstx[i];
    mst_orien[i][2] = msty[i];
    mst_orien[i][3] = mstz[i];
  }
  for (i = 1; i <= 3; i++) {
    pars[i] = 0.0;
    for (j = 1; j <= 3; j++)
      pars[i] += t1[j] * mst_orien[j][i];
  }
  phi = deg2rad(vec_ang(hinge, msty, mstz));
  pars[5] = rolltilt * cos(phi);
  pars[4] = rolltilt * sin(phi);
  free_dmatrix(para_bp1, 1, 3, 1, 3);
  free_dmatrix(para_bp2, 1, 3, 1, 3);
  free_dmatrix(temp, 1, 3, 1, 3);
}
```