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

```asm
<quikgray>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,%r15
  mov    %esi,%r12d
  mov    %edx,0x2c(%rsp)
  mov    %ecx,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x40(%rsp)
  movl   $0x1,0x44(%rsp)
  movl   $0x14,0x48(%rsp)
  movl   $0x15,0x4c(%rsp)
  movl   $0x2,0x50(%rsp)
  movl   $0x3,0x54(%rsp)
  movl   $0x11,0x58(%rsp)
  movl   $0x12,0x5c(%rsp)
  movl   $0x1,0x3c(%rsp)
  mov    %edx,%ecx
  imul   %esi,%ecx
  test   %ecx,%ecx
  jle    L66
  mov    %rdi,%rax
  lea    -0x1(%rcx),%edx
  lea    0x4(%rdi,%rdx,4),%rdx
  movss  D41(%rip),%xmm7
  movss  %xmm7,0xc(%rsp)
  pxor   %xmm0,%xmm0
  movaps %xmm0,%xmm2
L67:
  movss  (%rax),%xmm1
  addss  %xmm1,%xmm2
  movaps %xmm1,%xmm3
  mulss  %xmm1,%xmm3
  addss  %xmm3,%xmm0
  maxss  0xc(%rsp),%xmm1
  movss  %xmm1,0xc(%rsp)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L67
L107:
  pxor   %xmm1,%xmm1
  cvtsi2ss %ecx,%xmm1
  divss  %xmm1,%xmm2
  divss  %xmm1,%xmm0
  movaps %xmm2,%xmm1
  movss  %xmm2,0x14(%rsp)
  mulss  %xmm2,%xmm1
  subss  %xmm1,%xmm0
  call   <sqrt@plt>
  movss  %xmm0,0x18(%rsp)
  mulss  D6(%rip),%xmm0
  movss  0x14(%rsp),%xmm2
  addss  %xmm2,%xmm0
  movss  0xc(%rsp),%xmm7
  comiss %xmm7,%xmm0
  jbe    L119
  movaps %xmm7,%xmm0
  subss  %xmm2,%xmm0
  divss  D6(%rip),%xmm0
  movss  %xmm0,0x18(%rsp)
L119:
  cmpl   $0x0,0x2c(%rsp)
  jle    L99
  movl   $0x0,0x28(%rsp)
  movl   $0x0,0x1c(%rsp)
  mov    $0x0,%r14d
  lea    0x40(%rsp),%rax
  mov    %rax,0x20(%rsp)
  jmp    L48
L66:
  movss  D41(%rip),%xmm7
  movss  %xmm7,0xc(%rsp)
  pxor   %xmm0,%xmm0
  movaps %xmm0,%xmm2
  jmp    L107
L52:
  mov    $0x7,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  cltq
  mov    0x20(%rsp),%rsi
  lea    (%rsi,%rax,4),%rcx
  lea    0x38(%rsp),%rdx
  lea    0x34(%rsp),%rsi
  lea    0x3c(%rsp),%rdi
  call   <pgpt_@plt>
L114:
  add    $0x1,%ebp
  cmp    %ebp,%r13d
  je     L29
L85:
  add    $0x1,%ebx
  cmp    %ebx,%r12d
  cmove  %r14d,%ebx
  mov    0xc(%rsp),%eax
  add    %ebx,%eax
  cltq
  movss  (%r15,%rax,4),%xmm0
  subss  0x14(%rsp),%xmm0
  divss  0x18(%rsp),%xmm0
  cvttss2si %xmm0,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %ebp,%xmm0
  addss  D40(%rip),%xmm0
  movss  %xmm0,0x34(%rsp)
  movss  0x10(%rsp),%xmm6
  movss  %xmm6,0x38(%rsp)
  test   %eax,%eax
  jle    L114
  jmp    L52
L29:
  addl   $0x1,0x1c(%rsp)
  mov    0x1c(%rsp),%eax
  add    %r12d,0x28(%rsp)
  cmp    %eax,0x2c(%rsp)
  je     L99
L48:
  mov    0x28(%rsp),%eax
  mov    %eax,0xc(%rsp)
  mov    $0x0,%ebx
  mov    $0x0,%ebp
  test   %r13d,%r13d
  jle    L29
  pxor   %xmm0,%xmm0
  cvtsi2ssl 0x1c(%rsp),%xmm0
  addss  D40(%rip),%xmm0
  movss  %xmm0,0x10(%rsp)
  jmp    L85
L99:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L68
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L68:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D41
datatype: byte[4]
name: read_data
arguments: label: D6
datatype: f32
name: read_data
arguments: label: D40
datatype: byte[4]

tool: {"D41": [0xca,0xf2,0x49,0xf1]}

tool: D6: 7

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

assistant: ```c
void quikgray(float *dat, int nx, int ny, int nxx) {
  int ksym[8] = {0, 1, 20, 21, 2, 3, 17, 18};
  float s = 0.;
  float ss = 0.;
  float smin = 1.e30;
  float smax = -1.e30;
  float aa, rms, x, y;
  int i, ii, j, k;
  int one = 1;
  for (i = 0; i < nx * ny; i = i + 1) {
    aa = dat[i];
    s = s + aa;
    ss = ss + aa * aa;
    if (aa > smax)
      smax = aa;
    if (aa < smin)
      smin = aa;
  }
  s = s / (float)(nx * ny);
  rms = sqrt(ss / (float)(nx * ny) - s * s);
  if (s + 7 * rms > smax)
    rms = (smax - s) / 7.0;
  for (j = 0; j < ny; j = j + 1) {
    ii = 0;
    for (i = 0; i < nxx; i = i + 1) {
      ii = ii + 1;
      if (ii == nx)
        ii = 0;
      k = (int)((dat[(int)(j * nx + ii)] - s) / rms);
      if (k > 7)
        k = 7;
      x = (float)i + 1;
      y = (float)j + 1;
      if (k > 0)
        pgpt_(&one, &x, &y, ksym + k);
    }
  }
}
```