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

```asm
<PopCSn>:
  endbr64
  divsd  %xmm1,%xmm2
  push   %r15
  push   %r14
  push   %r13
  mov    %edi,%r13d
  push   %r12
  mov    %rdx,%r12
  sub    $0x6,%r13d
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x48,%rsp
  mulsd  D334(%rip),%xmm0
  movsd  %xmm3,0x10(%rsp)
  movq   %xmm0,%rbp
  cvttsd2si %xmm2,%r14d
  mov    %r14d,%edi
  call   <sqrt@plt>
  pxor   %xmm0,%xmm0
  movsd  D46(%rip),%xmm2
  mov    %ebx,%edi
  cvtsi2sd %eax,%xmm0
  mulsd  D38(%rip),%xmm0
  movsd  D253(%rip),%xmm4
  mov    D121(%rip),%rax
  movsd  %xmm0,(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2sd %r13d,%xmm0
  mulsd  %xmm0,%xmm2
  subsd  %xmm2,%xmm4
  movsd  D158(%rip),%xmm2
  mulsd  %xmm0,%xmm2
  mulsd  %xmm0,%xmm2
  addsd  %xmm4,%xmm2
  movsd  D266(%rip),%xmm4
  mulsd  %xmm0,%xmm4
  movapd %xmm4,%xmm1
  mulsd  %xmm0,%xmm1
  mulsd  %xmm1,%xmm0
  subsd  %xmm0,%xmm2
  movq   %rax,%xmm0
  movsd  %xmm2,0x8(%rsp)
  call   <pow@plt>
  movsd  D314(%rip),%xmm0
  mov    %ebx,%edi
  mov    %eax,%r13d
  call   <pow@plt>
  pxor   %xmm0,%xmm0
  movsd  (%rsp),%xmm1
  mov    %r14d,%edi
  mulsd  D276(%rip),%xmm1
  cvtsi2sd %r13d,%xmm0
  mulsd  D132(%rip),%xmm0
  divsd  %xmm0,%xmm1
  movsd  D69(%rip),%xmm0
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,0x18(%rsp)
  call   <sqrt@plt>
  movsd  D335(%rip),%xmm0
  mov    %ebx,%edi
  mov    %eax,%r13d
  call   <pow@plt>
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %r13d,%xmm0
  mulsd  D218(%rip),%xmm0
  cvtsi2sd %eax,%xmm1
  divsd  %xmm1,%xmm0
  call   <exp@plt>
  pxor   %xmm2,%xmm2
  movsd  0x10(%rsp),%xmm3
  mov    %eax,%r8d
  mov    $0xffffffff,%eax
  cltd
  idiv   %r8d
  add    $0x1,%eax
  imul   %ebx,%eax
  cmp    $0xa,%ebx
  cvtsi2sd %eax,%xmm2
  mulsd  0x8(%rsp),%xmm2
  jle    L166
  addsd  D384(%rip),%xmm2
L166:
  movapd %xmm3,%xmm0
  pxor   %xmm6,%xmm6
  pxor   %xmm5,%xmm5
  movsd  D152(%rip),%xmm4
  cmpnltsd %xmm6,%xmm0
  cvtsi2sd %ebx,%xmm5
  andpd  %xmm0,%xmm3
  andnpd %xmm2,%xmm0
  orpd   %xmm0,%xmm3
  movsd  D339(%rip),%xmm0
  addsd  %xmm5,%xmm0
  subsd  %xmm2,%xmm0
  cvttsd2si %xmm0,%eax
  test   %eax,%eax
  jle    L198
  cmp    $0x12,%eax
  jg     L52
  cmp    $0xa,%eax
  jle    L37
  movslq %eax,%rdx
  sar    $0x1f,%eax
  pxor   %xmm0,%xmm0
  imul   $0x38e38e39,%rdx,%rdx
  sar    $0x22,%rdx
  sub    %eax,%edx
  lea    0x2(%rdx),%eax
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm0,%xmm0
  mulsd  %xmm0,%xmm4
L198:
  test   %ebx,%ebx
  jle    L186
L115:
  lea    0x1(%rbx),%edx
  pxor   %xmm0,%xmm0
  mov    $0x1,%eax
  nop
L167:
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  add    $0x1,%eax
  addsd  %xmm1,%xmm0
  cmp    %edx,%eax
  jne    L167
  movapd %xmm0,%xmm1
  movapd %xmm2,%xmm7
  movsd  %xmm2,0x10(%rsp)
  addsd  %xmm0,%xmm1
  subsd  %xmm3,%xmm7
  mulsd  %xmm1,%xmm0
  movsd  D343(%rip),%xmm1
  movsd  %xmm7,0x8(%rsp)
  subsd  %xmm0,%xmm5
  movq   %rbp,%xmm0
  divsd  %xmm5,%xmm4
  movsd  D226(%rip),%xmm5
  mulsd  %xmm5,%xmm0
  movsd  %xmm5,0x28(%rsp)
  mulsd  %xmm4,%xmm1
  movapd %xmm1,%xmm3
  movsd  D65(%rip),%xmm1
  mulsd  %xmm4,%xmm3
  movq   D275(%rip),%xmm4
  movaps %xmm4,0x30(%rsp)
  divsd  %xmm3,%xmm1
  divsd  %xmm1,%xmm0
  xorpd  %xmm4,%xmm0
  call   <exp@plt>
  pxor   %xmm0,%xmm0
  movsd  0x10(%rsp),%xmm2
  mov    %ebx,%edi
  cvtsi2sd %eax,%xmm0
  mulsd  0x8(%rsp),%xmm0
  movsd  D253(%rip),%xmm1
  mov    D121(%rip),%rax
  divsd  %xmm2,%xmm0
  subsd  %xmm0,%xmm1
  movq   %rax,%xmm0
  mulsd  %xmm2,%xmm1
  movsd  %xmm1,0x10(%rsp)
  call   <pow@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  D132(%rip),%xmm0
  comisd (%rsp),%xmm0
  jae    L97
  lea    0x2(%rbx),%ebp
  pxor   %xmm4,%xmm4
  movsd  0x18(%rsp),%xmm6
  cvtsi2sd %ebp,%xmm4
  subsd  0x10(%rsp),%xmm4
  addsd  %xmm4,%xmm4
  divsd  %xmm6,%xmm4
  movapd %xmm4,%xmm0
  mulsd  %xmm4,%xmm0
  divsd  %xmm6,%xmm4
  mulsd  D339(%rip),%xmm0
L149:
  movq   $0x0,0x8(%rsp)
  mov    %ebp,%eax
  cs nopw 0x0(%rax,%rax,1)
L229:
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  sub    $0x1,%eax
  mulsd  %xmm4,%xmm1
  maxsd  0x8(%rsp),%xmm1
  movsd  %xmm1,0x8(%rsp)
  cmp    $0x1,%eax
  jne    L229
  mulsd  D339(%rip),%xmm0
  xor    %r14d,%r14d
  pxor   %xmm3,%xmm3
  movsd  %xmm0,(%rsp)
  jmp    L136
  nopl   0x0(%rax)
L79:
  mov    %r13d,%edi
  movsd  %xmm3,0x20(%rsp)
  movsd  %xmm4,0x18(%rsp)
  movsd  %xmm2,0x10(%rsp)
  call   <log@plt>
  movsd  (%rsp),%xmm1
  movsd  0x10(%rsp),%xmm2
  mov    $0x2,%edi
  subsd  D253(%rip),%xmm1
  mulsd  D339(%rip),%xmm2
  mulsd  %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  movsd  %xmm1,0x10(%rsp)
  call   <log@plt>
  movq   %xmm0,%r13
  movsd  (%rsp),%xmm0
  call   <lgamma@plt>
  movq   %r13,%xmm5
  movsd  0x10(%rsp),%xmm1
  mulsd  (%rsp),%xmm5
  subsd  %xmm5,%xmm1
  subsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  call   <exp@plt>
  pxor   %xmm0,%xmm0
  movsd  0x20(%rsp),%xmm3
  movsd  0x18(%rsp),%xmm4
  cvtsi2sd %eax,%xmm0
L102:
  mulsd  %xmm4,%xmm0
  movsd  %xmm0,(%r12,%r14,8)
  add    $0x1,%r14
  addsd  %xmm0,%xmm3
  cmp    %r14d,%ebx
  jl     L19
L136:
  mov    %ebp,%eax
  pxor   %xmm2,%xmm2
  movsd  (%rsp),%xmm7
  movsd  D51(%rip),%xmm6
  sub    %r14d,%eax
  cvtsi2sd %eax,%xmm2
  comisd %xmm7,%xmm6
  mulsd  %xmm4,%xmm2
  cvttsd2si %xmm2,%r13d
  jb     L79
  comisd D116(%rip),%xmm7
  jb     L79
  cvttsd2si 0x8(%rsp),%edi
  movsd  %xmm3,0x20(%rsp)
  movsd  %xmm2,0x18(%rsp)
  movsd  %xmm4,0x10(%rsp)
  call   <log@plt>
  call   <abs@plt>
  mulsd  (%rsp),%xmm0
  movsd  0x28(%rsp),%xmm7
  movsd  0x10(%rsp),%xmm4
  movsd  0x18(%rsp),%xmm2
  movsd  0x20(%rsp),%xmm3
  comisd %xmm0,%xmm7
  jb     L79
  movsd  D271(%rip),%xmm5
  comisd 0x8(%rsp),%xmm5
  jb     L79
  movsd  (%rsp),%xmm0
  subsd  D253(%rip),%xmm0
  mov    %r13d,%edi
  call   <pow@plt>
  movsd  0x18(%rsp),%xmm2
  movsd  D339(%rip),%xmm0
  xorpd  0x30(%rsp),%xmm2
  mov    %eax,%r13d
  mulsd  %xmm2,%xmm0
  call   <exp@plt>
  movsd  (%rsp),%xmm0
  mov    $0x2,%edi
  imul   %eax,%r13d
  call   <pow@plt>
  movsd  (%rsp),%xmm0
  mov    %eax,%r15d
  call   <lgamma@plt>
  call   <exp@plt>
  mov    %r15d,%ecx
  pxor   %xmm0,%xmm0
  movsd  0x10(%rsp),%xmm4
  imul   %eax,%ecx
  mov    %r13d,%eax
  movsd  0x20(%rsp),%xmm3
  cltd
  idiv   %ecx
  cvtsi2sd %eax,%xmm0
  jmp    L102
  nopl   0x0(%rax,%rax,1)
L97:
  movsd  0x18(%rsp),%xmm5
  xor    %r14d,%r14d
  pxor   %xmm3,%xmm3
  mov    $0x1,%ebp
  movapd %xmm5,%xmm0
  addsd  %xmm5,%xmm0
  mulsd  %xmm5,%xmm0
  mulsd  D106(%rip),%xmm5
  movsd  %xmm0,0x18(%rsp)
  cvttsd2si %xmm5,%r13d
  nopl   0x0(%rax)
L46:
  pxor   %xmm0,%xmm0
  mov    %r13d,%edi
  movsd  D385(%rip),%xmm7
  movsd  %xmm3,0x8(%rsp)
  cvtsi2sd %r14d,%xmm0
  subsd  0x10(%rsp),%xmm0
  mulsd  %xmm0,%xmm0
  divsd  0x18(%rsp),%xmm0
  minsd  %xmm0,%xmm7
  movsd  %xmm7,(%rsp)
  call   <sqrt@plt>
  movsd  (%rsp),%xmm0
  mov    %eax,%r15d
  call   <exp@plt>
  mov    %r15d,%ecx
  pxor   %xmm0,%xmm0
  movsd  0x8(%rsp),%xmm3
  imul   %eax,%ecx
  mov    %ebp,%eax
  cltd
  idiv   %ecx
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,(%r12,%r14,8)
  add    $0x1,%r14
  addsd  %xmm0,%xmm3
  cmp    %r14d,%ebx
  jge    L46
L19:
  xor    %eax,%eax
  pxor   %xmm1,%xmm1
  xor    %r8d,%r8d
  nopw   0x0(%rax,%rax,1)
L134:
  movsd  (%r12,%rax,8),%xmm0
  comisd %xmm1,%xmm0
  movapd %xmm0,%xmm6
  divsd  %xmm3,%xmm0
  maxsd  %xmm1,%xmm6
  cmova  %eax,%r8d
  movapd %xmm6,%xmm1
  movsd  %xmm0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jge    L134
L10:
  add    $0x48,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L52:
  movslq %eax,%rdx
  sar    $0x1f,%eax
  pxor   %xmm0,%xmm0
  imul   $0x38e38e39,%rdx,%rdx
  sar    $0x23,%rdx
  sub    %eax,%edx
  lea    0x3(%rdx),%eax
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm0,%xmm0
  mulsd  %xmm0,%xmm4
  test   %ebx,%ebx
  jg     L115
L186:
  divsd  %xmm5,%xmm4
  movapd %xmm2,%xmm5
  movq   %rbp,%xmm0
  movsd  D343(%rip),%xmm1
  subsd  %xmm3,%xmm5
  movsd  D226(%rip),%xmm7
  movsd  %xmm2,0x10(%rsp)
  mulsd  %xmm7,%xmm0
  movsd  %xmm7,0x28(%rsp)
  movsd  %xmm5,0x8(%rsp)
  mulsd  %xmm4,%xmm1
  movapd %xmm1,%xmm3
  movsd  D65(%rip),%xmm1
  mulsd  %xmm4,%xmm3
  movq   D275(%rip),%xmm4
  movaps %xmm4,0x30(%rsp)
  divsd  %xmm3,%xmm1
  divsd  %xmm1,%xmm0
  xorpd  %xmm4,%xmm0
  call   <exp@plt>
  pxor   %xmm0,%xmm0
  movsd  0x10(%rsp),%xmm2
  mov    %ebx,%edi
  cvtsi2sd %eax,%xmm0
  mulsd  0x8(%rsp),%xmm0
  movsd  D253(%rip),%xmm1
  mov    D121(%rip),%rax
  divsd  %xmm2,%xmm0
  subsd  %xmm0,%xmm1
  movq   %rax,%xmm0
  mulsd  %xmm2,%xmm1
  movsd  %xmm1,0x10(%rsp)
  call   <pow@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  D132(%rip),%xmm0
  comisd (%rsp),%xmm0
  jb     L72
  test   %ebx,%ebx
  je     L97
L170:
  xor    %r8d,%r8d
  jmp    L10
L37:
  cmp    $0x2,%eax
  jle    L198
  movslq %eax,%rdx
  sar    $0x1f,%eax
  pxor   %xmm0,%xmm0
  imul   $0x66666667,%rdx,%rdx
  sar    $0x22,%rdx
  sub    %eax,%edx
  lea    0x1(%rdx),%eax
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm0,%xmm0
  mulsd  %xmm0,%xmm4
  jmp    L198
L72:
  lea    0x2(%rbx),%ebp
  pxor   %xmm4,%xmm4
  movsd  0x18(%rsp),%xmm5
  cvtsi2sd %ebp,%xmm4
  subsd  0x10(%rsp),%xmm4
  addsd  %xmm4,%xmm4
  divsd  %xmm5,%xmm4
  movapd %xmm4,%xmm0
  mulsd  %xmm4,%xmm0
  mulsd  D339(%rip),%xmm0
  divsd  %xmm5,%xmm4
  test   %ebx,%ebx
  js     L170
  jmp    L149
```

tool_calls: name: retrieve_data
arguments: tag: D334
datatype: f32[2]
name: retrieve_data
arguments: tag: D46
datatype: byte[8]
name: retrieve_data
arguments: tag: D38
datatype: f64
name: retrieve_data
arguments: tag: D253
datatype: f64
name: retrieve_data
arguments: tag: D121
datatype: f64
name: retrieve_data
arguments: tag: D158
datatype: byte[8]
name: retrieve_data
arguments: tag: D266
datatype: byte[8]
name: retrieve_data
arguments: tag: D314
datatype: f64
name: retrieve_data
arguments: tag: D276
datatype: f64
name: retrieve_data
arguments: tag: D132
datatype: f64
name: retrieve_data
arguments: tag: D69
datatype: f64
name: retrieve_data
arguments: tag: D335
datatype: f64
name: retrieve_data
arguments: tag: D218
datatype: f64
name: retrieve_data
arguments: tag: D384
datatype: f64
name: retrieve_data
arguments: tag: D152
datatype: f64
name: retrieve_data
arguments: tag: D339
datatype: f64
name: retrieve_data
arguments: tag: D343
datatype: f64
name: retrieve_data
arguments: tag: D226
datatype: f32[2]
name: retrieve_data
arguments: tag: D65
datatype: f32[2]
name: retrieve_data
arguments: tag: D275
datatype: f32[2]
name: retrieve_data
arguments: tag: D51
datatype: f64
name: retrieve_data
arguments: tag: D116
datatype: byte[16]
name: retrieve_data
arguments: tag: D271
datatype: f32[2]
name: retrieve_data
arguments: tag: D106
datatype: byte[8]
name: retrieve_data
arguments: tag: D385
datatype: f32[2]

tool: {"D334": [0.0,4.4765625]}

tool: {"D46": [0x49,0x68,0xcb,0xb9,0x14,0x57,0x75,0x3f]}

tool: D38: 1389200000

tool: D253: 1

tool: D121: 0.45

tool: {"D158": [0xa5,0x27,0x76,0x7e,0x9b,0x0f,0x19,0x3f]}

tool: {"D266": [0xc9,0x35,0x3d,0xdc,0x99,0xff,0xa3,0x3e]}

tool: D314: 0.4

tool: D276: 0.0571

tool: D132: 360000000

tool: D69: 0.426

tool: D335: 0.447

tool: D218: 3.8585

tool: D384: 0.2

tool: D152: 0.529

tool: D339: 0.5

tool: D343: 3.141592654

tool: {"D226": [0.0,3.140625]}

tool: {"D65": [0.0,2.5625]}

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

tool: D51: 57.5

tool: {"D116": [0xa0,0xc2,0xeb,0xfe,0x4b,0x48,0xb4,0x39,0x00,0x00,0x00,0x00,0x00,0x40,0x55,0x40]}

tool: {"D271": [0.0,3.33203125]}

tool: {"D106": [0x50,0x45,0x52,0x54,0xfb,0x21,0x19,0x40]}

tool: {"D385": [0.0,3.0625]}

assistant: ```c
int PopCSn(int ZTarg, double TT, int ZP, double MP, double E, double QI, double CS[]) {
  int Q = 0, ZT = 0, NE = 0;
  double Sum = 0, Q0 = 0, Width = 0, WP = 0, V = 0, E_A = 0, QInf = 0, ZRat = 0, VP = 3.6E8, A = 3.8585, T = 0, TMax = 0, NU = 0, S = 0, C = 0, IBar = 0, ALam = 0, Arg = 0, Core = 0, N = 0, XSect = 0, B = 0.447;
  TT = TT * 1000;
  E_A = E / MP;
  V = 13.892E8 * sqrt(E_A);
  ZT = ZTarg - 6;
  ZRat = 1.0 - (5.21E-3 * ZT) + (9.56E-5 * ZT * ZT) - (5.96E-7 * ZT * ZT * ZT);
  S = (0.426 - 0.0571 * V / (VP * pow(ZP, 0.45))) * pow(ZP, 0.4);
  IBar = ZP * (1 - 1 / exp(A * sqrt(E_A) / pow(ZP, B))) * ZRat;
  if (ZP > 10)
    IBar += 0.2;
  QInf = IBar;
  if (QI < 0.0)
    QI = QInf;
  NE = (int)(0.5 + ZP - IBar);
  if (NE < 1)
    NE = 1;
  if (NE > 18)
    N = 3 + NE / 36;
  else if (NE > 10)
    N = 2 + NE / 18;
  else if (NE > 2)
    N = 1 + NE / 10;
  else
    N = 1;
  Sum = 0;
  for (Q = 1; Q <= ZP; Q++)
    Sum += Q;
  Core = ZP - 2 * Sum * Sum;
  XSect = N * N * 0.529 / Core;
  XSect = 3.141592654 * XSect * XSect;
  ALam = 50 * TT / (10 / XSect);
  IBar = IBar * (1 - (IBar - QI) * exp(-ALam) / IBar);
  Sum = 0;
  if (V <= 3.6E8 * pow(ZP, 0.45))
    for (Q = 0; Q <= ZP; Q++) {
      Arg = (Q - IBar) * (Q - IBar) / (2 * S * S);
      if (Arg > 40)
        Arg = 40;
      Sum += CS[Q] = 1 / (sqrt(2 * 3.141592654 * S) * exp(Arg));
    }
  else {
    C = 2 * (ZP + 2 - IBar) / S;
    NU = C * C / 2;
    C /= S;
    TMax = 0;
    for (Q = 0; Q <= ZP; Q++)
      if ((T = C * (ZP - Q + 2)) > TMax)
        TMax = T;
    for (Q = 0; Q <= ZP; Q++) {
      T = C * (ZP - Q + 2);
      if (((NU / 2 <= 57.5) && (NU / 2 >= 1E-30)) && (0.5 * NU * abs(log(TMax)) <= 50) && (TMax <= 85))
        CS[Q] = pow(T, NU / 2 - 1) * exp(-T / 2) / (pow(2, NU / 2) * exp(lgamma(NU / 2)));
      else
        CS[Q] = exp((NU / 2 - 1) * log(T) - T / 2 - (NU / 2) * log(2) - lgamma(NU / 2));
      CS[Q] *= C;
      Sum += CS[Q];
    }
  }
  ZT = 0;
  A = 0;
  for (Q = 0; Q <= ZP; Q++) {
    if (CS[Q] > A) {
      A = CS[Q];
      ZT = Q;
    }
    CS[Q] = CS[Q] / Sum;
  };
  return ZT;
}
```