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

```asm
<calculate_gldm>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %rsi,(%rsp)
  mov    %rdx,%r15
  mov    %rcx,%rbp
  mov    %r8,%rbx
  mov    %r9,0x58(%rsp)
  mov    0xa8(%rsp),%r13d
  movslq %r13d,%r12
  lea    0x0(,%r13,8),%edi
  call   <malloc@plt>
  mov    %rax,%r14
  mov    0xa0(%rsp),%eax
  lea    0x1(%rax,%rax,1),%eax
  mov    %eax,0x44(%rsp)
  imul   0xb8(%rsp),%eax
  cltq
  mov    %rax,0x48(%rsp)
  movslq (%r15),%rcx
  mov    %rcx,0x20(%rsp)
  mov    0x0(%rbp),%r8d
  imul   (%rbx),%r8d
  movslq %r8d,%r8
  cmp    $0x1,%r12
  jbe    L252
  mov    $0x1,%eax
L220:
  mov    0x0(%rbp,%rax,4),%edx
  imul   (%rbx,%rax,4),%edx
  movslq %edx,%rdx
  add    %rdx,%r8
  movslq (%r15,%rax,4),%rdx
  imul   %rdx,%rcx
  add    $0x1,%rax
  cmp    %rax,%r12
  jne    L220
  mov    %rcx,0x20(%rsp)
L252:
  cmp    %r8,0x20(%rsp)
  jbe    L205
  lea    0x0(,%r12,4),%rax
  mov    %rax,0x8(%rsp)
  lea    0x0(%rbp,%rax,1),%r10
  lea    -0x1(%r13),%eax
  cltq
  lea    (%r14,%rax,8),%rax
  mov    %rax,0x28(%rsp)
  lea    -0x1(%r13),%eax
  mov    %eax,0x40(%rsp)
  movslq 0xa0(%rsp),%rax
  mov    %rax,0x50(%rsp)
  movsd  D1(%rip),%xmm1
  jmp    L128
L80:
  movslq 0x0(%rbp,%rcx,4),%rdx
  cmp    %rdx,%rax
  jae    L91
  mov    %rdx,%rdi
  sub    %rax,%rdi
  movslq (%rbx,%rcx,4),%rax
  imul   %rax,%rdi
  add    %rdi,%r8
  mov    %rdx,(%rsi)
L91:
  sub    $0x8,%rsi
  sub    $0x1,%rcx
  je     L257
L151:
  movslq -0x4(%rbx,%rcx,4),%rdi
  mov    %r8,%rax
  mov    $0x0,%edx
  div    %rdi
  movslq (%rbx,%rcx,4),%rdi
  mov    %rdx,%rax
  mov    $0x0,%edx
  div    %rdi
  mov    %rax,(%rsi)
  movslq (%r10,%rcx,4),%rdx
  cmp    %rdx,%rax
  jbe    L80
  movslq 0x0(%rbp,%rcx,4),%rdi
  movslq (%r15,%rcx,4),%rdx
  add    %rdi,%rdx
  sub    %rax,%rdx
  movslq (%rbx,%rcx,4),%rax
  imul   %rax,%rdx
  add    %rdx,%r8
  mov    %rdi,(%rsi)
  jmp    L91
L257:
  movslq (%rbx),%rcx
  mov    %r8,%rax
  mov    $0x0,%edx
  div    %rcx
  mov    %rax,(%r14)
  movslq (%r10),%rdx
  cmp    %rdx,%rax
  ja     L205
  mov    (%rsp),%rax
  cmpb   $0x0,(%rax,%r8,1)
  jne    L234
L175:
  add    $0x1,%r8
  cmp    0x20(%rsp),%r8
  jae    L205
L128:
  movslq 0x40(%rsp),%rcx
  test   %rcx,%rcx
  je     L257
  mov    0x28(%rsp),%rsi
  jmp    L151
L234:
  mov    0x50(%rsp),%rax
  test   %rax,%rax
  je     L86
  mov    0x10(%rsp),%rsi
  lea    (%rsi,%r8,4),%rsi
  mov    %rsi,0x30(%rsp)
  mov    0x58(%rsp),%r11
  movl   $0x0,0x1c(%rsp)
  mov    $0x0,%r13d
  mov    %r15,0x38(%rsp)
  mov    %rax,%r15
  jmp    L164
L170:
  cmp    %r8,%rdi
  je     L156
  mov    (%rsp),%rax
  cmpb   $0x0,(%rax,%rdi,1)
  je     L156
  mov    0x30(%rsp),%rax
  mov    (%rax),%eax
  mov    0x10(%rsp),%rsi
  mov    (%rsi,%rdi,4),%edx
  mov    %edx,%ecx
  sub    %eax,%ecx
  sub    %edx,%eax
  cmovs  %ecx,%eax
  cmp    0xc0(%rsp),%eax
  setle  %al
  movzbl %al,%eax
  add    %eax,0x1c(%rsp)
L156:
  add    $0x1,%r13
  add    0x8(%rsp),%r11
  cmp    %r15,%r13
  je     L279
L164:
  mov    %r14,%rsi
  mov    %r8,%rdi
  mov    $0x0,%eax
  test   %r12,%r12
  je     L156
L93:
  mov    (%r11,%rax,4),%edx
  movslq %edx,%rcx
  add    (%rsi),%rcx
  movslq 0x0(%rbp,%rax,4),%r9
  cmp    %r9,%rcx
  jb     L156
  movslq (%r10,%rax,4),%r9
  cmp    %r9,%rcx
  ja     L156
  imul   (%rbx,%rax,4),%edx
  movslq %edx,%rdx
  add    %rdx,%rdi
  add    $0x1,%rax
  add    $0x8,%rsi
  cmp    %rax,%r12
  jne    L93
  jmp    L170
L86:
  movl   $0x0,0x1c(%rsp)
  jmp    L179
L279:
  mov    0x38(%rsp),%r15
L179:
  mov    0x10(%rsp),%rax
  mov    (%rax,%r8,4),%edx
  lea    -0x1(%rdx),%eax
  imul   0x44(%rsp),%eax
  add    0x1c(%rsp),%eax
  cltq
  cmp    %rax,0x48(%rsp)
  jbe    L158
  test   %edx,%edx
  jle    L158
  mov    0xb0(%rsp),%rsi
  lea    (%rsi,%rax,8),%rax
  movapd %xmm1,%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L175
L158:
  mov    %r14,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L191
L205:
  mov    %r14,%rdi
  call   <free@plt>
  mov    $0x1,%eax
L191:
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D1
type: byte[8]

tool: {"D1": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

assistant: ```c
int calculate_gldm(int *image, char *mask, int *size, int *bb, int *strides, int *angles, int Na, int Nd, double *gldm, int Ng, int alpha) {
  size_t Ni;
  size_t i, j;
  size_t *cur_idx = (size_t *)malloc(sizeof *cur_idx * Nd);
  size_t a, d;
  int dep, diff;
  size_t gldm_idx, gldm_idx_max = Ng * (Na * 2 + 1);
  Ni = size[0];
  i = bb[0] * strides[0];
  for (d = 1; d < Nd; d++) {
    i += bb[d] * strides[d];
    Ni *= size[d];
  }
  for (; i < Ni; i++) {
    for (d = Nd - 1; d > 0; d--) {
      cur_idx[d] = (i % strides[d - 1]) / strides[d];
      if (cur_idx[d] > bb[Nd + d]) {
        i += (size[d] - cur_idx[d] + bb[d]) * strides[d];
        cur_idx[d] = bb[d];
      } else if (cur_idx[d] < bb[d]) {
        i += (bb[d] - cur_idx[d]) * strides[d];
        cur_idx[d] = bb[d];
      }
    }
    cur_idx[0] = i / strides[0];
    if (cur_idx[0] > bb[Nd])
      break;
    if (mask[i]) {
      dep = 0;
      for (a = 0; a < Na; a++) {
        j = i;
        for (d = 0; d < Nd; d++) {
          if (cur_idx[d] + angles[a * Nd + d] < bb[d] || cur_idx[d] + angles[a * Nd + d] > bb[Nd + d]) {
            j = i;
            break;
          }
          j += angles[a * Nd + d] * strides[d];
        }
        if (j != i && mask[j]) {
          diff = image[i] - image[j];
          if (diff < 0)
            diff *= -1;
          if (diff <= alpha)
            dep++;
        }
      }
      gldm_idx = dep + (image[i] - 1) * (Na * 2 + 1);
      if (image[i] <= 0 || gldm_idx >= gldm_idx_max) {
        free(cur_idx);
        return 0;
      }
      gldm[gldm_idx]++;
    }
  }
  free(cur_idx);
  return 1;
}
```