user: What is the c source code of the assembly code below:

```asm
<computegradient>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %esi,0x10(%rsp)
  cmp    $0x2,%edx
  jle    L59
  mov    %rdi,%r12
  mov    %rcx,%r15
  mov    %r8,%r14
  mov    %esi,%eax
  lea    -0x1(%rsi),%r13d
  lea    -0x1(%rdx),%edi
  mov    %edi,0x1c(%rsp)
  add    %eax,%eax
  mov    %eax,0x18(%rsp)
  movl   $0x1,0xc(%rsp)
  jmp    L23
L102:
  call   <sqrtf@plt>
L79:
  movss  0x14(%rsp),%xmm1
  divss  %xmm0,%xmm1
  movss  %xmm1,(%r15,%rbx,1)
  movss  (%r14,%rbx,1),%xmm1
  divss  %xmm0,%xmm1
  movss  %xmm1,(%r14,%rbx,1)
L107:
  add    $0x1,%ebp
  add    $0x4,%rbx
  cmp    %r13d,%ebp
  je     L99
L54:
  movss  (%r12,%rbx,1),%xmm0
  comiss D42(%rip),%xmm0
  jbe    L107
  movss  D13(%rip),%xmm3
  comiss %xmm0,%xmm3
  jbe    L107
  movslq %ebp,%rdi
  lea    0x0(,%rdi,4),%rsi
  lea    -0x4(%r12,%rsi,1),%r8
  mov    0x18(%rsp),%eax
  add    %ebp,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    -0x4(%r12,%rdx,1),%rcx
  lea    0x4(%r12,%rsi,1),%rsi
  lea    0x4(%r12,%rdx,1),%rdx
  movss  (%r8),%xmm0
  xorps  D61(%rip),%xmm0
  movss  -0x4(%r12,%rbx,1),%xmm1
  mulss  D86(%rip),%xmm1
  subss  %xmm1,%xmm0
  subss  (%rcx),%xmm0
  addss  (%rsi),%xmm0
  movss  0x4(%r12,%rbx,1),%xmm1
  mulss  D86(%rip),%xmm1
  addss  %xmm1,%xmm0
  addss  (%rdx),%xmm0
  movss  %xmm0,(%r15,%rbx,1)
  movss  (%r8),%xmm0
  xorps  D61(%rip),%xmm0
  movss  (%r12,%rdi,4),%xmm1
  mulss  D86(%rip),%xmm1
  subss  %xmm1,%xmm0
  subss  (%rsi),%xmm0
  addss  (%rcx),%xmm0
  movss  (%r12,%rax,4),%xmm1
  mulss  D86(%rip),%xmm1
  addss  %xmm1,%xmm0
  addss  (%rdx),%xmm0
  movss  %xmm0,(%r14,%rbx,1)
  movss  (%r15,%rbx,1),%xmm1
  movss  %xmm1,0x14(%rsp)
  mulss  %xmm1,%xmm1
  mulss  %xmm0,%xmm0
  addss  %xmm1,%xmm0
  comiss D42(%rip),%xmm0
  jbe    L107
  pxor   %xmm1,%xmm1
  ucomiss %xmm0,%xmm1
  ja     L102
  sqrtss %xmm0,%xmm0
  jmp    L79
L99:
  addl   $0x1,0xc(%rsp)
  mov    0xc(%rsp),%eax
  add    0x10(%rsp),%r13d
  cmp    0x1c(%rsp),%eax
  je     L59
L23:
  cmpl   $0x2,0x10(%rsp)
  jle    L99
  mov    %r13d,%eax
  sub    0x10(%rsp),%eax
  lea    0x2(%rax),%ebp
  lea    0x1(%r13),%eax
  cltq
  lea    0x4(,%rax,4),%rbx
  jmp    L54
L59:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D42
type: byte[4]
name: retrieve_data
arguments: tag: D13
type: byte[4]
name: retrieve_data
arguments: tag: D61
type: byte[16]
name: retrieve_data
arguments: tag: D86
type: byte[4]

tool: {"D42": [0x00,0x00,0x00,0x00]}

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

tool: {"D61": [0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: {"D86": [0xf4,0x04,0xb5,0x3f]}

assistant: ```c
void computegradient(const float *img, int w, int h, float *gx, float *gy) {
  int i, j, k, p, q;
  float glength, phi, phiscaled, ascaled, errsign, pfrac, qfrac, err0, err1, err;
  for (i = 1; i < h - 1; i++) {
    for (j = 1; j < w - 1; j++) {
      k = i * w + j;
      if ((img[k] > 0) && (img[k] < 1)) {
        gx[k] = -img[k - w - 1] - 1.4142136f * img[k - 1] - img[k + w - 1] + img[k - w + 1] + 1.4142136f * img[k + 1] + img[k + w + 1];
        gy[k] = -img[k - w - 1] - 1.4142136f * img[k - w] - img[k - w + 1] + img[k + w - 1] + 1.4142136f * img[k + w] + img[k + w + 1];
        glength = gx[k] * gx[k] + gy[k] * gy[k];
        if (glength > 0) {
          glength = sqrtf(glength);
          gx[k] = gx[k] / glength;
          gy[k] = gy[k] / glength;
        }
      }
    }
  }
}
```