user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<bayer_unshuffle_preview>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %edi,-0x44(%rbp)
  mov    %esi,-0x48(%rbp)
  mov    %edx,-0x4c(%rbp)
  mov    %rcx,-0x58(%rbp)
  mov    %r8,-0x60(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x4c(%rbp),%eax
  mov    -0x44(%rbp),%edx
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    %edx,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x4c(%rbp),%eax
  mov    -0x48(%rbp),%edx
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    %edx,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x4c(%rbp),%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  movl   $0x0,-0x28(%rbp)
  jmp    L103
L45:
  movl   $0x0,-0x2c(%rbp)
  jmp    L7
L44:
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x30(%rbp)
  jmp    L22
L25:
  movl   $0x0,-0x34(%rbp)
  jmp    L62
L78:
  mov    -0x34(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  sete   %al
  movzbl %al,%edx
  mov    -0x30(%rbp),%eax
  and    $0x1,%eax
  add    %edx,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  cltq
  mov    -0x14(%rbp,%rax,4),%esi
  mov    -0x30(%rbp),%eax
  imul   -0x44(%rbp),%eax
  mov    %eax,%edi
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  mov    -0x2c(%rbp),%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  lea    (%rdi,%rax,1),%edx
  mov    -0x34(%rbp),%eax
  sar    %eax
  add    %eax,%edx
  mov    -0x34(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  jne    L35
  mov    -0x44(%rbp),%eax
  sar    %eax
  jmp    L51
L35:
  mov    $0x0,%eax
L51:
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  lea    (%rsi,%rax,1),%edx
  mov    -0x18(%rbp),%eax
  cltq
  mov    %edx,-0x14(%rbp,%rax,4)
  addl   $0x1,-0x34(%rbp)
L62:
  mov    -0x34(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L78
  addl   $0x1,-0x30(%rbp)
L22:
  mov    -0x30(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L25
  mov    -0x14(%rbp),%edx
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  add    %eax,%eax
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    %edx,%eax
  mov    %eax,%edx
  mov    -0x60(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%edx
  mov    -0x4c(%rbp),%eax
  add    %eax,%eax
  sub    $0x1,%eax
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    -0x60(%rbp),%rax
  add    $0x1,%rax
  mov    %dl,(%rax)
  mov    -0xc(%rbp),%edx
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  add    %eax,%eax
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    -0x60(%rbp),%rax
  add    $0x2,%rax
  mov    %dl,(%rax)
  addl   $0x1,-0x2c(%rbp)
  addq   $0x3,-0x60(%rbp)
L7:
  mov    -0x2c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L44
  addl   $0x1,-0x28(%rbp)
  mov    -0x4c(%rbp),%eax
  mov    -0x44(%rbp),%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  cltq
  add    %rax,-0x58(%rbp)
L103:
  mov    -0x28(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L45
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L80
  call   <__stack_chk_fail@plt>
L80:
  leave
  ret
```

assistant: ```c
void bayer_unshuffle_preview(int w, int h, int scale, unsigned char *raw, unsigned char *output) {
  int x, y, nx, ny;
  int colour;
  int rgb[3];
  int nw = w >> scale;
  int nh = h >> scale;
  int incr = 1 << scale;
  for (ny = 0; ny < nh; ++ny, raw += w << scale) {
    for (nx = 0; nx < nw; ++nx, output += 3) {
      rgb[0] = 0;
      rgb[1] = 0;
      rgb[2] = 0;
      for (y = 0; y < incr; ++y) {
        for (x = 0; x < incr; ++x) {
          colour = 1 - (x & 1) + (y & 1);
          rgb[colour] += raw[y * w + (nx << (scale - 1)) + (x >> 1) + ((x & 1) ? 0 : (w >> 1))];
        }
      }
      output[0] = rgb[0] >> (2 * scale - 2);
      output[1] = rgb[1] >> (2 * scale - 1);
      output[2] = rgb[2] >> (2 * scale - 2);
    }
  }
}
```