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

```asm
<integrated_profile>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1d8,%rsp
  mov    %esi,0x10(%rsp)
  mov    %edx,0x78(%rsp)
  movsd  %xmm0,0x30(%rsp)
  movsd  %xmm1,0x38(%rsp)
  mov    %r8,0x40(%rsp)
  mov    %r9,0x48(%rsp)
  mov    0x210(%rsp),%r14
  mov    %fs:0x28,%rdx
  mov    %rdx,0x1c8(%rsp)
  xor    %edx,%edx
  cvttsd2si (%rcx),%ebp
  movsd  0x8(%rcx),%xmm5
  movsd  %xmm5,0x20(%rsp)
  movsd  0x10(%rcx),%xmm1
  mov    0x18(%rcx),%rbx
  movsd  0x20(%rcx),%xmm6
  movsd  %xmm6,(%rsp)
  movsd  0x28(%rcx),%xmm7
  movsd  %xmm7,0x28(%rsp)
  test   %edi,%edi
  je     L99
  pxor   %xmm0,%xmm0
  cmp    $0x1,%edi
  jne    L50
  mov    D327(%rip),%rax
  mov    %rax,0x100(%rsp)
  movq   $0x0,0x108(%rsp)
  mov    D106(%rip),%rax
  mov    %rax,0x110(%rsp)
  movq   $0x0,0x118(%rsp)
  mov    D73(%rip),%rax
  mov    %rax,0x120(%rsp)
  mov    D84(%rip),%rax
  mov    %rax,0x128(%rsp)
  mov    D316(%rip),%rax
  mov    %rax,0x130(%rsp)
  mov    D43(%rip),%rax
  mov    %rax,0x138(%rsp)
  movsd  D256(%rip),%xmm0
  movsd  %xmm0,0x180(%rsp)
  mov    D245(%rip),%rax
  mov    %rax,0x188(%rsp)
  movsd  %xmm0,0x190(%rsp)
  movq   $0x0,0x198(%rsp)
  movsd  D299(%rip),%xmm0
  movsd  %xmm0,0x1a0(%rsp)
  movsd  D152(%rip),%xmm2
  movsd  %xmm2,0x1a8(%rsp)
  movsd  %xmm2,0x1b0(%rsp)
  movsd  %xmm0,0x1b8(%rsp)
  movapd %xmm1,%xmm7
  mulsd  %xmm1,%xmm7
  movsd  %xmm7,0x18(%rsp)
  movq   %rbx,%xmm5
  mulsd  %xmm5,%xmm5
  movsd  %xmm5,0x68(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0x10(%rsp),%xmm0
  movsd  D49(%rip),%xmm3
  subsd  %xmm3,%xmm0
  movsd  D253(%rip),%xmm2
  movapd %xmm0,%xmm4
  addsd  %xmm2,%xmm4
  movsd  %xmm4,0x58(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0x78(%rsp),%xmm0
  subsd  %xmm3,%xmm0
  movapd %xmm0,%xmm3
  addsd  %xmm2,%xmm3
  movsd  %xmm3,0x70(%rsp)
  movapd %xmm4,%xmm2
  mulsd  %xmm4,%xmm2
  divsd  %xmm7,%xmm2
  movapd %xmm3,%xmm0
  mulsd  %xmm3,%xmm0
  divsd  %xmm5,%xmm0
  addsd  %xmm0,%xmm2
  mulsd  %xmm3,%xmm4
  movapd %xmm4,%xmm0
  mulsd  (%rsp),%xmm0
  addsd  %xmm0,%xmm2
  mulsd  D333(%rip),%xmm2
  addsd  D127(%rip),%xmm2
  pxor   %xmm0,%xmm0
  comisd D82(%rip),%xmm2
  jbe    L123
L50:
  mov    0x1c8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  add    $0x1d8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L99:
  mov    %esi,%r15d
  pxor   %xmm0,%xmm0
  cvtsi2sd %esi,%xmm0
  movapd %xmm0,%xmm5
  subsd  D49(%rip),%xmm5
  movapd %xmm1,%xmm3
  mulsd  D346(%rip),%xmm3
  movsd  D253(%rip),%xmm0
  movsd  %xmm5,0x8(%rsp)
  addsd  %xmm5,%xmm0
  movsd  %xmm3,0x10(%rsp)
  divsd  %xmm3,%xmm0
  call   <erf@plt>
  movq   %xmm0,%r12
  movsd  0x8(%rsp),%xmm5
  subsd  D253(%rip),%xmm5
  movapd %xmm5,%xmm0
  divsd  0x10(%rsp),%xmm0
  call   <erf@plt>
  movq   %xmm0,%r13
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0x78(%rsp),%xmm0
  movapd %xmm0,%xmm4
  subsd  D49(%rip),%xmm4
  movq   %rbx,%xmm6
  mulsd  D346(%rip),%xmm6
  movsd  D253(%rip),%xmm0
  movsd  %xmm4,0x8(%rsp)
  addsd  %xmm4,%xmm0
  movsd  %xmm6,0x10(%rsp)
  divsd  %xmm6,%xmm0
  call   <erf@plt>
  movq   %xmm0,%rbx
  movsd  0x8(%rsp),%xmm4
  subsd  D253(%rip),%xmm4
  movapd %xmm4,%xmm0
  divsd  0x10(%rsp),%xmm0
  call   <erf@plt>
  movapd %xmm0,%xmm2
  movsd  D253(%rip),%xmm0
  mulsd  0x20(%rsp),%xmm0
  mulsd  D120(%rip),%xmm0
  movsd  D108(%rip),%xmm1
  mulsd  %xmm1,%xmm0
  mulsd  %xmm1,%xmm0
  movq   %r12,%xmm1
  movq   %r13,%xmm4
  subsd  %xmm4,%xmm1
  mulsd  %xmm1,%xmm0
  movq   %rbx,%xmm1
  subsd  %xmm2,%xmm1
  mulsd  %xmm1,%xmm0
  mov    %ebp,%eax
  shr    $0x1f,%eax
  add    %ebp,%eax
  sar    %eax
  lea    -0xf(%rax,%r15,2),%edx
  test   %edx,%edx
  js     L50
  cmp    %edx,%ebp
  jle    L50
  mov    0x78(%rsp),%esi
  lea    -0xf(%rax,%rsi,2),%eax
  test   %eax,%eax
  js     L50
  cmp    %eax,%ebp
  jle    L50
  imul   %ebp,%eax
  add    %edx,%eax
  cltq
  movsd  0x30(%rsp),%xmm1
  subsd  0x28(%rsp),%xmm1
  mov    0x48(%rsp),%rdi
  mulsd  (%rdi,%rax,8),%xmm1
  mov    0x40(%rsp),%rsi
  addsd  (%rsi,%rax,8),%xmm1
  movsd  0x38(%rsp),%xmm2
  subsd  (%rsp),%xmm2
  mulsd  (%r14,%rax,8),%xmm2
  addsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm0
  jmp    L50
L123:
  movq   %rbx,%xmm7
  mulsd  %xmm1,%xmm7
  movsd  %xmm7,0x50(%rsp)
  movsd  D159(%rip),%xmm1
  movapd %xmm2,%xmm0
  call   <pow@plt>
  mulsd  0x50(%rsp),%xmm0
  movsd  D127(%rip),%xmm1
  divsd  %xmm0,%xmm1
  comisd D272(%rip),%xmm1
  jae    L35
  comisd D264(%rip),%xmm1
  jae    L95
  comisd D305(%rip),%xmm1
  jae    L130
  comisd D101(%rip),%xmm1
  jb     L253
  movapd %xmm1,%xmm6
  mulsd  D81(%rip),%xmm6
  movsd  %xmm6,0x8(%rsp)
  jmp    L230
L35:
  mov    $0x4,%r13d
  pxor   %xmm3,%xmm3
  movsd  %xmm3,0x8(%rsp)
L230:
  comisd D305(%rip),%xmm1
  jae    L155
L94:
  movsd  0x8(%rsp),%xmm0
  mulsd  0x20(%rsp),%xmm0
  mov    %ebp,%eax
  shr    $0x1f,%eax
  add    %ebp,%eax
  sar    %eax
  mov    0x10(%rsp),%edi
  lea    -0xf(%rax,%rdi,2),%edx
  test   %edx,%edx
  js     L50
  cmp    %edx,%ebp
  jle    L50
  mov    0x78(%rsp),%edi
  lea    -0xf(%rax,%rdi,2),%eax
  test   %eax,%eax
  js     L50
  cmp    %eax,%ebp
  jle    L50
  imul   %eax,%ebp
  lea    0x0(%rbp,%rdx,1),%eax
  cltq
  movsd  0x30(%rsp),%xmm1
  subsd  0x28(%rsp),%xmm1
  mov    0x48(%rsp),%rdi
  mulsd  (%rdi,%rax,8),%xmm1
  mov    0x40(%rsp),%rsi
  addsd  (%rsi,%rax,8),%xmm1
  movsd  0x38(%rsp),%xmm2
  subsd  (%rsp),%xmm2
  mulsd  (%r14,%rax,8),%xmm2
  addsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm0
  jmp    L50
L95:
  mov    $0x3,%r13d
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x8(%rsp)
  jmp    L230
L253:
  pxor   %xmm3,%xmm3
  movsd  %xmm3,0x8(%rsp)
  jmp    L230
L130:
  mov    $0x2,%r13d
  pxor   %xmm4,%xmm4
  movsd  %xmm4,0x8(%rsp)
L155:
  movslq %r13d,%rcx
  mov    %rcx,%r12
  shl    $0x5,%r12
  lea    0xc0(%rsp,%r12,1),%rdx
  mov    $0x0,%eax
L180:
  movsd  0x58(%rsp),%xmm0
  addsd  (%rdx,%rax,8),%xmm0
  movsd  %xmm0,0x80(%rsp,%rax,8)
  mulsd  %xmm0,%xmm0
  divsd  0x18(%rsp),%xmm0
  movsd  %xmm0,0xa0(%rsp,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%r13d
  jg     L180
  lea    -0x1(%r13),%eax
  lea    0x1(%rax,%rcx,4),%rax
  shl    $0x3,%rax
  lea    0x140(%rsp,%r12,1),%r15
  mov    %ebp,0x7c(%rsp)
  mov    %rax,%rbp
L237:
  movsd  0x70(%rsp),%xmm0
  addsd  0xc0(%rsp,%r12,1),%xmm0
  movsd  %xmm0,0x58(%rsp)
  mulsd  %xmm0,%xmm0
  divsd  0x68(%rsp),%xmm0
  movsd  %xmm0,0x60(%rsp)
  mov    $0x0,%ebx
L183:
  movsd  0x140(%rsp,%r12,1),%xmm0
  mulsd  (%r15,%rbx,8),%xmm0
  movsd  %xmm0,0x18(%rsp)
  movsd  0x58(%rsp),%xmm6
  mulsd  0x80(%rsp,%rbx,8),%xmm6
  movapd %xmm6,%xmm0
  mulsd  (%rsp),%xmm0
  movsd  0x60(%rsp),%xmm1
  addsd  0xa0(%rsp,%rbx,8),%xmm1
  addsd  %xmm1,%xmm0
  mulsd  D333(%rip),%xmm0
  addsd  D127(%rip),%xmm0
  mov    D159(%rip),%rax
  movq   %rax,%xmm1
  call   <pow@plt>
  movapd %xmm0,%xmm1
  mulsd  0x50(%rsp),%xmm1
  movsd  D81(%rip),%xmm7
  divsd  %xmm1,%xmm7
  movapd %xmm7,%xmm0
  mulsd  0x18(%rsp),%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  add    $0x1,%rbx
  cmp    %ebx,%r13d
  jg     L183
  add    $0x8,%r12
  cmp    %rbp,%r12
  jne    L237
  mov    0x7c(%rsp),%ebp
  jmp    L94
L17:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D327
type_infered: byte[8]
name: retrieve_data
arguments: tag: D106
type_infered: f64
name: retrieve_data
arguments: tag: D73
type_infered: byte[8]
name: retrieve_data
arguments: tag: D84
type_infered: byte[8]
name: retrieve_data
arguments: tag: D316
type_infered: f64
name: retrieve_data
arguments: tag: D43
type_infered: f64
name: retrieve_data
arguments: tag: D256
type_infered: f64
name: retrieve_data
arguments: tag: D245
type_infered: f64
name: retrieve_data
arguments: tag: D299
type_infered: f64
name: retrieve_data
arguments: tag: D152
type_infered: f64
name: retrieve_data
arguments: tag: D49
type_infered: f64
name: retrieve_data
arguments: tag: D253
type_infered: f64
name: retrieve_data
arguments: tag: D333
type_infered: f64
name: retrieve_data
arguments: tag: D127
type_infered: f64
name: retrieve_data
arguments: tag: D82
type_infered: f64[2]
name: retrieve_data
arguments: tag: D346
type_infered: f64
name: retrieve_data
arguments: tag: D120
type_infered: f64
name: retrieve_data
arguments: tag: D108
type_infered: f64
name: retrieve_data
arguments: tag: D159
type_infered: f64
name: retrieve_data
arguments: tag: D272
type_infered: f64[2]
name: retrieve_data
arguments: tag: D264
type_infered: f64[2]
name: retrieve_data
arguments: tag: D305
type_infered: f64[2]
name: retrieve_data
arguments: tag: D101
type_infered: byte[16]
name: retrieve_data
arguments: tag: D81
type_infered: f32[2]

tool: {"D327": [0x7e,0x4e,0x49,0xef,0x7e,0xc9,0xd8,0xbf]}

tool: D106: 0.38729833

tool: {"D73": [0x80,0x87,0x79,0xc1,0x6d,0x8e,0xdb,0xbf]}

tool: {"D84": [0x27,0xd8,0x03,0xd6,0x3f,0xc2,0xc5,0xbf]}

tool: D316: 0.16999052

tool: D43: 0.43056816

tool: D256: 0.27777778

tool: D245: 0.44444444

tool: D299: 0.17392742

tool: D152: 0.32607258

tool: D49: 7.5

tool: D253: 0.5

tool: D333: 0.3195079

tool: D127: 1

tool: {"D82": [10000.0,2.5]}

tool: D346: 1.41421356

tool: D120: 3.14159265

tool: D108: 0.8493218

tool: D159: 2.5

tool: {"D272": [0.046,0.0022]}

tool: {"D264": [0.0022,0.0001]}

tool: {"D305": [0.0001,1e-10]}

tool: {"D101": [0xbb,0xbd,0xd7,0xd9,0xdf,0x7c,0xdb,0x3d,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x3f]}

tool: {"D81": [0.0,1.9375]}

assistant: ```c
double integrated_profile(int profile_type, int idx, int idy, double xpos, double ypos, double *psf_parameters, double *lut_0, double *lut_xd, double *lut_yd) {
  int psf_size;
  double psf_height, psf_sigma_x, psf_sigma_y, psf_xpos, psf_ypos;
  double p0;
  int ip, jp;
  double pi = 3.14159265, fwtosig = 0.8493218;
  psf_size = (int)psf_parameters[0];
  psf_height = psf_parameters[1];
  psf_sigma_x = psf_parameters[2];
  psf_sigma_y = psf_parameters[3];
  psf_ypos = psf_parameters[4];
  psf_xpos = psf_parameters[5];
  if (profile_type == 0) {
    p0 = 0.5 * psf_height * pi * fwtosig * fwtosig * (erf((idx - 7.5 + 0.5) / (1.41421356 * psf_sigma_x)) - erf((idx - 7.5 - 0.5) / (1.41421356 * psf_sigma_x))) * (erf((idy - 7.5 + 0.5) / (1.41421356 * psf_sigma_y)) - erf((idy - 7.5 - 0.5) / (1.41421356 * psf_sigma_y)));
    ip = psf_size / 2 + 2 * idx - 15;
    jp = psf_size / 2 + 2 * idy - 15;
    if ((ip >= 0) && (ip <= psf_size - 1) && (jp >= 0) && (jp <= psf_size - 1)) {
      p0 += lut_0[ip + psf_size * jp] + lut_xd[ip + psf_size * jp] * (xpos - psf_xpos) + lut_yd[ip + psf_size * jp] * (ypos - psf_ypos);
    }
    return p0;
  } else if (profile_type == 1) {
    double d[4][4] = {{0.0, 0.0, 0.0, 0.0}, {-0.28867513, 0.28867513, 0.0, 0.0}, {-0.38729833, 0.0, 0.38729833, 0.0}, {-0.43056816, -0.16999052, 0.16999052, 0.43056816}};
    double w[4][4] = {{1.0, 0.0, 0.0, 0.0}, {0.5, 0.5, 0.0, 0.0}, {0.27777778, 0.44444444, 0.27777778, 0.0}, {0.17392742, 0.32607258, 0.32607258, 0.17392742}};
    double alpha = 0.3195079;
    double p1sq, p2sq, p1p2, dx, dy, xy, denom, func, x[4], xsq[4], p1xsq[4];
    double y, ysq, p2ysq, wt, p4fod, wp4fod, wf;
    int npt, ix, iy;
    p1sq = psf_parameters[2] * psf_parameters[2];
    p2sq = psf_parameters[3] * psf_parameters[3];
    p1p2 = psf_parameters[2] * psf_parameters[3];
    dx = idx - 7.5 + 0.5;
    dy = idy - 7.5 + 0.5;
    xy = dx * dy;
    denom = 1.0 + alpha * (dx * dx / p1sq + dy * dy / p2sq + xy * psf_parameters[4]);
    if (denom > 1.0e4) {
      return 0.0;
    }
    p0 = 0.0;
    func = 1.0 / (p1p2 * pow(denom, 2.5));
    if (func >= 0.046) {
      npt = 4;
    } else if (func >= 0.0022) {
      npt = 3;
    } else if (func >= 0.0001) {
      npt = 2;
    } else if (func >= 1.0e-10) {
      p0 = (2.5 - 1.0) * func;
    }
    if (func >= 0.0001) {
      for (ix = 0; ix < npt; ix++) {
        x[ix] = dx + d[npt][ix];
        xsq[ix] = x[ix] * x[ix];
        p1xsq[ix] = xsq[ix] / p1sq;
      }
      for (iy = 0; iy < npt; iy++) {
        y = dy + d[npt][iy];
        ysq = y * y;
        p2ysq = ysq / p2sq;
        for (ix = 0; ix < npt; ix++) {
          wt = w[npt][iy] * w[npt][ix];
          xy = x[ix] * y;
          denom = 1.0 + alpha * (p1xsq[ix] + p2ysq + xy * psf_parameters[4]);
          func = (2.5 - 1.0) / (p1p2 * pow(denom, 2.5));
          p4fod = 2.5 * alpha * func / denom;
          wp4fod = wt * p4fod;
          wf = wt * func;
          p0 += wf;
        }
      }
    }
    p0 *= psf_parameters[1];
    ip = psf_size / 2 + 2 * idx - 15;
    jp = psf_size / 2 + 2 * idy - 15;
    if ((ip >= 0) && (ip <= psf_size - 1) && (jp >= 0) && (jp <= psf_size - 1)) {
      p0 += lut_0[ip + psf_size * jp] + lut_xd[ip + psf_size * jp] * (xpos - psf_xpos) + lut_yd[ip + psf_size * jp] * (ypos - psf_ypos);
    }
    return p0;
  } else {
    return 0.0;
  }
}
```