user: 请将以下的汇编代码转换成C语言代码：

```asm
<_bin2d_double>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    0x38(%rsp),%ebp
  mov    %r9d,-0x10(%rsp)
  test   %r8d,%r8d
  jle    L95
  test   %r9d,%r9d
  jle    L95
  test   %ebp,%ebp
  jle    L95
  mov    %esi,%r11d
  mov    %edx,%eax
  cmp    $0x1,%esi
  jne    L20
  mov    %rcx,-0x30(%rsp)
  movslq %r8d,%rbx
  lea    -0x1(%rdx),%r9d
  xor    %r13d,%r13d
  mov    -0x10(%rsp),%r15d
  mov    %rbx,-0x28(%rsp)
  movslq %r9d,%r9
  lea    0x0(,%rbx,8),%r14
  movq   $0x0,-0x38(%rsp)
  mov    %ebp,%ebx
L153:
  mov    -0x30(%rsp),%rcx
  mov    %ebp,%esi
  xor    %r11d,%r11d
  xor    %r12d,%r12d
L40:
  movsd  (%rcx),%xmm0
  mov    %r13d,%r10d
  nopw   0x0(%rax,%rax,1)
L167:
  mov    %r11d,%edx
  nopl   0x0(%rax,%rax,1)
L32:
  cmp    %edx,%eax
  jg     L49
  addsd  (%rdi,%r9,8),%xmm0
  add    $0x1,%edx
  movsd  %xmm0,(%rcx)
  cmp    %edx,%esi
  jne    L32
  add    $0x1,%r10d
  cmp    %r10d,%ebx
  jne    L167
L65:
  add    $0x1,%r12d
  add    %r14,%rcx
  add    %ebp,%esi
  add    %ebp,%r11d
  cmp    %r12d,%r15d
  jne    L40
  addq   $0x1,-0x38(%rsp)
  add    %ebp,%ebx
  mov    -0x38(%rsp),%rsi
  add    %ebp,%r13d
  addq   $0x8,-0x30(%rsp)
  cmp    -0x28(%rsp),%rsi
  jne    L153
L95:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L49:
  movslq %edx,%r8
  add    $0x1,%edx
  addsd  (%rdi,%r8,8),%xmm0
  movsd  %xmm0,(%rcx)
  cmp    %edx,%esi
  jne    L32
  add    $0x1,%r10d
  cmp    %r10d,%ebx
  jne    L167
  jmp    L65
L20:
  movslq %r8d,%rbx
  lea    -0x1(%rax),%r13d
  mov    %rcx,-0x18(%rsp)
  mov    %ebp,%r14d
  mov    %rbx,-0x8(%rsp)
  shl    $0x3,%rbx
  imul   %esi,%r13d
  lea    -0x1(%rsi),%r15d
  mov    %rbx,-0x20(%rsp)
  lea    0x0(%rbp,%rbp,1),%ebx
  movl   $0x0,-0x28(%rsp)
  movq   $0x0,-0x30(%rsp)
  mov    %ebx,-0xc(%rsp)
L90:
  movl   $0x0,-0x38(%rsp)
  mov    -0x18(%rsp),%rsi
  mov    %ebp,%r8d
L109:
  mov    %r8d,%r12d
  movsd  (%rsi),%xmm0
  mov    -0x28(%rsp),%ebx
  sub    %ebp,%r12d
  nop
L70:
  cmp    %ebx,%r11d
  mov    %ebx,%r10d
  mov    %r12d,%edx
  cmovle %r15d,%r10d
  lea    0x0(%r13,%r10,1),%r9d
  movslq %r9d,%r9
  nopl   (%rax)
L97:
  cmp    %edx,%eax
  jg     L60
  addsd  (%rdi,%r9,8),%xmm0
  add    $0x1,%edx
  movsd  %xmm0,(%rsi)
  cmp    %r8d,%edx
  jne    L97
L134:
  add    $0x1,%ebx
  cmp    %r14d,%ebx
  jne    L70
  mov    -0xc(%rsp),%ecx
  addl   $0x1,-0x38(%rsp)
  add    -0x20(%rsp),%rsi
  mov    -0x38(%rsp),%ebx
  lea    (%rcx,%r12,1),%r8d
  cmp    %ebx,-0x10(%rsp)
  jne    L109
  addq   $0x1,-0x30(%rsp)
  add    %ebp,%r14d
  mov    -0x30(%rsp),%rbx
  add    %ebp,-0x28(%rsp)
  addq   $0x8,-0x18(%rsp)
  cmp    -0x8(%rsp),%rbx
  jne    L90
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L60:
  mov    %r11d,%ecx
  imul   %edx,%ecx
  add    $0x1,%edx
  add    %r10d,%ecx
  movslq %ecx,%rcx
  addsd  (%rdi,%rcx,8),%xmm0
  movsd  %xmm0,(%rsi)
  cmp    %edx,%r8d
  jne    L97
  jmp    L134
```

assistant: ```c
int _bin2d_double(double *in, int nx, int ny, double *out, int fx, int fy, int binfact) {
  int i1, i2, j1, j2, i, j;
  for (i1 = 0; i1 < fx; i1++) {
    for (j1 = 0; j1 < fy; j1++) {
      for (i2 = 0; i2 < binfact; i2++) {
        for (j2 = 0; j2 < binfact; j2++) {
          i = i1 * binfact + i2;
          if (i >= nx) {
            i = nx - 1;
          }
          j = j1 * binfact + j2;
          if (j >= ny) {
            j = ny - 1;
          }
          out[i1 + j1 * fx] += in[i + j * nx];
        }
      }
    }
  }
  return (0);
}
```