user: What would the C source look like for the assembly code provided here?

```asm
<gamma_index>:
  endbr64
  divsd  %xmm1,%xmm0
  push   %r15
  movslq %edi,%rax
  mov    %rcx,%r15
  push   %r14
  lea    0x0(,%rax,4),%r14
  push   %r13
  mov    %r14,%rdi
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  mov    %rax,%rbx
  sub    $0x48,%rsp
  mov    %rdx,0x8(%rsp)
  mov    %eax,0x10(%rsp)
  mov    %r8,0x18(%rsp)
  mov    %rax,0x30(%rsp)
  movsd  %xmm1,0x20(%rsp)
  movsd  %xmm0,(%rsp)
  call   <malloc@plt>
  movsd  (%rsp),%xmm0
  mov    0x8(%rsp),%rdx
  mov    %rax,%r13
  lea    -0x4(%r14),%rax
  mov    %rax,0x28(%rsp)
  lea    -0x1(%rbx),%eax
  test   %eax,%eax
  mov    %eax,0x14(%rsp)
  movl   $0x1,-0x4(%r13,%r14,1)
  jle    L80
  mov    $0x1,%edi
  cltq
  mov    $0x1,%ebx
  nopw   0x0(%rax,%rax,1)
L76:
  mov    (%r12,%rax,4),%ecx
  imul   %ecx,%edi
  imul   %ecx,%ebx
  mov    %edi,-0x4(%r13,%rax,4)
  sub    $0x1,%rax
  test   %eax,%eax
  jg     L76
L78:
  imul   (%r12),%ebx
  mov    %rdx,0x38(%rsp)
  movsd  %xmm0,(%rsp)
  movslq %ebx,%rdi
  lea    0x0(,%rdi,8),%rbp
  mov    %edi,0x8(%rsp)
  mov    %rbp,%rdi
  call   <malloc@plt>
  mov    %rbp,%rdi
  mov    %rax,%rbx
  call   <malloc@plt>
  mov    %rax,%rbp
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jle    L156
  cmp    $0x1,%eax
  movsd  (%rsp),%xmm0
  mov    0x38(%rsp),%rdx
  je     L47
  shr    %eax
  movapd %xmm0,%xmm2
  mov    %eax,%edi
  unpcklpd %xmm2,%xmm2
  xor    %eax,%eax
  shl    $0x4,%rdi
  nopl   0x0(%rax)
L9:
  movupd (%rdx,%rax,1),%xmm1
  divpd  %xmm2,%xmm1
  movups %xmm1,(%rbx,%rax,1)
  movupd (%r15,%rax,1),%xmm1
  divpd  %xmm2,%xmm1
  movups %xmm1,0x0(%rbp,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rdi
  jne    L9
  mov    0x8(%rsp),%ecx
  mov    %ecx,%eax
  and    $0xfffffffe,%eax
  and    $0x1,%ecx
  je     L84
L148:
  cltq
  movsd  (%rdx,%rax,8),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,(%rbx,%rax,8)
  movsd  (%r15,%rax,8),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x0(%rbp,%rax,8)
L84:
  mov    %r14,%rdi
  call   <malloc@plt>
  mov    0x10(%rsp),%edx
  mov    %rax,%r14
  test   %edx,%edx
  jle    L82
  mov    0x30(%rsp),%rdx
  xor    %esi,%esi
  mov    %rax,%rdi
  shl    $0x2,%rdx
  call   <memset@plt>
L82:
  mov    0x28(%rsp),%r10
  mov    %rbx,%r8
  xor    %r15d,%r15d
  mov    %r12,%rbx
  add    %r14,%r10
  mov    %r10,%r12
  nopl   (%rax)
L176:
  mov    0x10(%rsp),%edi
  xor    %eax,%eax
  mov    %rbp,%r9
  mov    %r14,%rcx
  mov    %r13,%rdx
  mov    %rbx,%rsi
  mov    %r8,(%rsp)
  call   <gamma_index_point@plt>
  pxor   %xmm0,%xmm0
  pxor   %xmm3,%xmm3
  mov    (%rsp),%r8
  cvtsi2sd %eax,%xmm0
  ucomisd %xmm0,%xmm3
  ja     L147
  sqrtsd %xmm0,%xmm0
L117:
  mov    0x18(%rsp),%rax
  divsd  0x20(%rsp),%xmm0
  addl   $0x1,(%r12)
  movsd  %xmm0,(%rax,%r15,8)
  movslq 0x14(%rsp),%rax
  test   %eax,%eax
  jg     L65
  jmp    L159
  nopw   0x0(%rax,%rax,1)
L14:
  addl   $0x1,-0x4(%r14,%rax,4)
  movl   $0x0,(%r14,%rax,4)
  sub    $0x1,%rax
  test   %eax,%eax
  jle    L159
L65:
  mov    (%rbx,%rax,4),%esi
  cmp    %esi,(%r14,%rax,4)
  je     L14
L159:
  add    $0x1,%r15
  cmp    %r15d,0x8(%rsp)
  jg     L176
  mov    %r8,%rbx
L155:
  mov    %r13,%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  add    $0x48,%rsp
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <free@plt>
L80:
  mov    $0x1,%ebx
  jmp    L78
L156:
  mov    %r14,%rdi
  call   <malloc@plt>
  mov    %rax,%r14
  mov    0x10(%rsp),%eax
  test   %eax,%eax
  jle    L155
  mov    0x30(%rsp),%rdx
  xor    %esi,%esi
  mov    %r14,%rdi
  shl    $0x2,%rdx
  call   <memset@plt>
  jmp    L155
L47:
  xor    %eax,%eax
  jmp    L148
L147:
  mov    %r8,(%rsp)
  call   <sqrt@plt>
  mov    (%rsp),%r8
  jmp    L117
```

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);
}
```