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

```asm
<hist2d>:
  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)
  mov    %r9,-0x40(%rbp)
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L49
L132:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  ucomisd D75(%rip),%xmm0
  jp     L122
  ucomisd D75(%rip),%xmm0
  je     L69
L122:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  ucomisd D75(%rip),%xmm0
  jp     L63
  ucomisd D75(%rip),%xmm0
  je     L69
L63:
  addl   $0x1,-0x4(%rbp)
L69:
  addl   $0x1,-0x10(%rbp)
L49:
  mov    -0x10(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jl     L132
  movl   $0x0,-0xc(%rbp)
  jmp    L93
L57:
  movl   $0x0,-0x8(%rbp)
  jmp    L155
L101:
  movl   $0x0,-0x10(%rbp)
  jmp    L37
L131:
  mov    -0xc(%rbp),%eax
  imul   0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  ucomisd D75(%rip),%xmm0
  jp     L110
  ucomisd D75(%rip),%xmm0
  je     L141
L110:
  mov    -0x8(%rbp),%eax
  imul   0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  ucomisd D75(%rip),%xmm0
  jp     L68
  ucomisd D75(%rip),%xmm0
  je     L141
L68:
  mov    -0xc(%rbp),%eax
  imul   0x20(%rbp),%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  imul   0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x8(%rbp),%eax
  imul   0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2sdl -0x4(%rbp),%xmm2
  divsd  %xmm2,%xmm0
  mov    -0xc(%rbp),%eax
  imul   0x20(%rbp),%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
L141:
  addl   $0x1,-0x10(%rbp)
L37:
  mov    -0x10(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jl     L131
  addl   $0x1,-0x8(%rbp)
L155:
  mov    -0x8(%rbp),%eax
  cmp    0x20(%rbp),%eax
  jl     L101
  addl   $0x1,-0xc(%rbp)
L93:
  mov    -0xc(%rbp),%eax
  cmp    0x20(%rbp),%eax
  jl     L57
  nop
  nop
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D75
data_type: byte[8]

tool: {"D75": [0xea,0x8c,0xa0,0x39,0x59,0x3e,0x29,0x46]}

assistant: ```c
void hist2d(const double *x, const double *y, const int *knots, const double *wx, const double *wy, double *hist, int numSamples, int splineOrder, int numBins) {
  int curSample;
  int curBinX, curBinY;
  int nbDef = 0;
  for (curSample = 0; curSample < numSamples; curSample++) {
    if ((wx[curSample] != 1e+30) && (wy[curSample] != 1e+30))
      nbDef += 1;
  }
  for (curBinX = 0; curBinX < numBins; curBinX++) {
    for (curBinY = 0; curBinY < numBins; curBinY++) {
      for (curSample = 0; curSample < numSamples; curSample++) {
        if ((wx[curBinX * numSamples + curSample] != 1e+30) && (wy[curBinY * numSamples + curSample] != 1e+30)) {
          hist[curBinX * numBins + curBinY] += wx[curBinX * numSamples + curSample] * wy[curBinY * numSamples + curSample] / (double)nbDef;
        }
      }
    }
  }
}
```