user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<upsample_cpu>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %edx,-0x30(%rbp)
  mov    %ecx,-0x34(%rbp)
  mov    %r8d,-0x38(%rbp)
  mov    %r9d,-0x3c(%rbp)
  movss  %xmm0,-0x40(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L53
L55:
  movl   $0x0,-0x10(%rbp)
  jmp    L88
L44:
  movl   $0x0,-0x14(%rbp)
  jmp    L77
L29:
  movl   $0x0,-0x18(%rbp)
  jmp    L7
L68:
  mov    -0xc(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  imul   -0x30(%rbp),%eax
  imul   -0x34(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  imul   -0x30(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x14(%rbp),%eax
  cltd
  idivl  -0x3c(%rbp)
  imul   -0x2c(%rbp),%eax
  add    %eax,%ecx
  mov    -0x18(%rbp),%eax
  cltd
  idivl  -0x3c(%rbp)
  add    %ecx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  imul   -0x30(%rbp),%eax
  imul   -0x34(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  imul   -0x30(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  add    %eax,%edx
  mov    -0x14(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  add    %eax,%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,0x10(%rbp)
  je     L32
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  mulss  -0x40(%rbp),%xmm0
  movss  %xmm0,(%rax)
  jmp    L24
L32:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  -0x40(%rbp),%xmm0
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
L24:
  addl   $0x1,-0x18(%rbp)
L7:
  mov    -0x2c(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  cmp    %eax,-0x18(%rbp)
  jl     L68
  addl   $0x1,-0x14(%rbp)
L77:
  mov    -0x30(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  cmp    %eax,-0x14(%rbp)
  jl     L29
  addl   $0x1,-0x10(%rbp)
L88:
  mov    -0x10(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L44
  addl   $0x1,-0xc(%rbp)
L53:
  mov    -0xc(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L55
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void upsample_cpu(float *in, int w, int h, int c, int batch, int stride, int forward, float scale, float *out) {
  int i, j, k, b;
  for (b = 0; b < batch; ++b) {
    for (k = 0; k < c; ++k) {
      for (j = 0; j < h * stride; ++j) {
        for (i = 0; i < w * stride; ++i) {
          int in_index = b * w * h * c + k * w * h + (j / stride) * w + i / stride;
          int out_index = b * w * h * c * stride * stride + k * w * h * stride * stride + j * w * stride + i;
          if (forward)
            out[out_index] = scale * in[in_index];
          else
            in[in_index] += scale * out[out_index];
        }
      }
    }
  }
}
```