user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<gamma_index>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rsi,%rbx
  mov    %rdx,%r13
  mov    %rcx,%r14
  mov    %r8,0x38(%rsp)
  movsd  %xmm1,0x28(%rsp)
  divsd  %xmm1,%xmm0
  movsd  %xmm0,0x20(%rsp)
  mov    %edi,0x8(%rsp)
  movslq %edi,%r15
  shl    $0x2,%r15
  mov    %r15,0x30(%rsp)
  mov    %r15,%rdi
  call   <malloc@plt>
  mov    %rax,%rbp
  lea    -0x4(%r15),%r12
  movl   $0x1,-0x4(%rax,%r15,1)
  mov    0x8(%rsp),%edi
  lea    -0x1(%rdi),%r15d
  test   %r15d,%r15d
  jle    L93
  movslq %r15d,%rax
  mov    $0x1,%ecx
L178:
  mov    (%rbx,%rax,4),%edx
  mov    %edx,%esi
  imul   0x0(%rbp,%rax,4),%esi
  mov    %esi,-0x4(%rbp,%rax,4)
  imul   %edx,%ecx
  sub    $0x1,%rax
  test   %eax,%eax
  jg     L178
L111:
  imul   (%rbx),%ecx
  mov    %ecx,0xc(%rsp)
  movslq %ecx,%rax
  shl    $0x3,%rax
  mov    %rax,0x18(%rsp)
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  mov    0x18(%rsp),%rdi
  call   <malloc@plt>
  mov    %rax,%rsi
  mov    %rax,0x18(%rsp)
  mov    0xc(%rsp),%edx
  test   %edx,%edx
  jle    L48
  mov    %edx,%edx
  mov    $0x0,%eax
  mov    0x10(%rsp),%rcx
L118:
  movsd  0x0(%r13,%rax,8),%xmm0
  movsd  0x20(%rsp),%xmm2
  divsd  %xmm2,%xmm0
  movsd  %xmm0,(%rcx,%rax,8)
  movsd  (%r14,%rax,8),%xmm0
  divsd  %xmm2,%xmm0
  movsd  %xmm0,(%rsi,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L118
  mov    0x30(%rsp),%rdi
  call   <malloc@plt>
  mov    %rax,%r13
  cmpl   $0x0,0x8(%rsp)
  jle    L125
L81:
  mov    $0x0,%eax
  mov    0x8(%rsp),%edx
L100:
  movl   $0x0,0x0(%r13,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%edx
  jg     L100
  cmpl   $0x0,0xc(%rsp)
  jle    L102
L125:
  mov    $0x0,%r14d
  mov    %rbp,0x20(%rsp)
  mov    0x38(%rsp),%rbp
  jmp    L67
L93:
  mov    $0x1,%ecx
  jmp    L111
L16:
  call   <sqrt@plt>
  jmp    L2
L58:
  add    $0x1,%r14
  cmp    %r14d,0xc(%rsp)
  jle    L156
L67:
  mov    0x18(%rsp),%r9
  mov    0x10(%rsp),%r8
  mov    %r13,%rcx
  mov    0x20(%rsp),%rdx
  mov    %rbx,%rsi
  mov    0x8(%rsp),%edi
  mov    $0x0,%eax
  call   <gamma_index_point@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  pxor   %xmm3,%xmm3
  ucomisd %xmm0,%xmm3
  ja     L16
  sqrtsd %xmm0,%xmm0
L2:
  divsd  0x28(%rsp),%xmm0
  movsd  %xmm0,0x0(%rbp,%r14,8)
  addl   $0x1,0x0(%r13,%r12,1)
  test   %r15d,%r15d
  jle    L58
  movslq %r15d,%rax
L94:
  mov    (%rbx,%rax,4),%edi
  cmp    %edi,0x0(%r13,%rax,4)
  jne    L58
  movl   $0x0,0x0(%r13,%rax,4)
  addl   $0x1,-0x4(%r13,%rax,4)
  sub    $0x1,%rax
  test   %eax,%eax
  jg     L94
  jmp    L58
L156:
  mov    0x20(%rsp),%rbp
L102:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L48:
  mov    0x30(%rsp),%rdi
  call   <malloc@plt>
  mov    %rax,%r13
  cmpl   $0x0,0x8(%rsp)
  jg     L81
  jmp    L102
```

assistant: ```c
void gamma_index(int ndim, int *shape, double *first_matrix, double *second_matrix, double *result, double dd, double dta) {
  double rel_dd = dd / dta;
  double *first_matrix_rel;
  double *second_matrix_rel;
  int *strides;
  int *running_index;
  int total_size = 1;
  int i;
  strides = (int *)malloc(sizeof(int) * ndim);
  strides[ndim - 1] = 1;
  for (i = ndim - 1; i > 0; i--) {
    strides[i - 1] = strides[i] * shape[i];
    total_size *= shape[i];
  }
  total_size *= shape[0];
  first_matrix_rel = malloc(sizeof(double) * total_size);
  second_matrix_rel = malloc(sizeof(double) * total_size);
  for (i = 0; i < total_size; i++) {
    first_matrix_rel[i] = first_matrix[i] / rel_dd;
    second_matrix_rel[i] = second_matrix[i] / rel_dd;
  }
  running_index = (int *)malloc(sizeof(int) * ndim);
  for (i = 0; i < ndim; i++) {
    running_index[i] = 0;
  }
  for (int j = 0; j < total_size; j++) {
    result[j] = sqrt(gamma_index_point(ndim, shape, strides, running_index, first_matrix_rel, second_matrix_rel)) / dta;
    running_index[ndim - 1]++;
    i = ndim - 1;
    for (i = ndim - 1; i > 0; i--) {
      if (running_index[i] == shape[i]) {
        running_index[i] = 0;
        running_index[i - 1]++;
      } else {
        break;
      }
    }
  }
  free(strides);
  free(running_index);
  free(first_matrix_rel);
  free(second_matrix_rel);
}
```