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

```asm
<idx_add2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8,-0x38(%rbp)
  movsd  %xmm0,-0x40(%rbp)
  mov    %r9d,-0x44(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L11
L4:
  movl   $0x0,-0xc(%rbp)
  jmp    L28
L37:
  mov    -0x8(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x8(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x8(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0x8(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x8(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x8(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x8(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  movsd  -0x40(%rbp),%xmm0
  subsd  %xmm3,%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0x8(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0xc(%rbp)
L28:
  mov    -0xc(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jl     L37
  mov    0x10(%rbp),%eax
  add    %eax,-0x8(%rbp)
  mov    0x18(%rbp),%eax
  add    %eax,-0x4(%rbp)
  addl   $0x1,-0x10(%rbp)
L11:
  mov    -0x10(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L4
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void idx_add2(double output[], int idx1[], int idx2[], double data[], double mult[], double ds, int ix, int jx1, int jx2) {
  int i, j, lim1 = 0, lim2 = 0;
  for (i = 0; i < ix; i++) {
    for (j = 0; j < jx1; j++) {
      output[lim2 + idx1[lim1 + j]] = output[lim2 + idx1[lim1 + j]] + mult[lim1 + j] * data[lim1 + j];
      output[lim2 + idx2[lim1 + j]] = output[lim2 + idx2[lim1 + j]] + mult[lim1 + j] * (ds - data[lim1 + j]);
    }
    lim1 = lim1 + jx1;
    lim2 = lim2 + jx2;
  }
}
```