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

```asm
<downsample_component>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x1a8,%rsp
  mov    %rdi,-0xd8(%rbp)
  mov    %esi,-0xdc(%rbp)
  mov    %edx,-0xe0(%rbp)
  mov    %ecx,-0xe4(%rbp)
  mov    %r8d,-0xe8(%rbp)
  mov    %r9d,-0xec(%rbp)
  mov    0x18(%rbp),%rax
  mov    %rax,-0xf8(%rbp)
  mov    0x20(%rbp),%rax
  mov    %rax,-0x100(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    -0xec(%rbp),%eax
  add    %eax,%eax
  sub    $0x1,%eax
  mov    %eax,-0xc8(%rbp)
  mov    -0xc8(%rbp),%edx
  movslq %edx,%rax
  sub    $0x1,%rax
  mov    %rax,-0xc0(%rbp)
  movslq %edx,%rax
  mov    %rax,%r10
  mov    $0x0,%r11d
  movslq %edx,%rax
  mov    %rax,%r12
  mov    $0x0,%r13d
  movslq %edx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rdx
  mov    %rdx,%rax
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rcx
  sub    %rax,%rcx
L292:
  cmp    %rcx,%rsp
  je     L105
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L292
L105:
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  mov    %rdx,%rax
  and    $0xfff,%eax
  test   %rax,%rax
  je     L182
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L182:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0xb8(%rbp)
  mov    -0xc8(%rbp),%edx
  movslq %edx,%rax
  sub    $0x1,%rax
  mov    %rax,-0xb0(%rbp)
  movslq %edx,%rax
  mov    %rax,%r14
  mov    $0x0,%r15d
  movslq %edx,%rax
  mov    %rax,-0x110(%rbp)
  movq   $0x0,-0x108(%rbp)
  movslq %edx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rdx
  mov    %rdx,%rax
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rcx
  sub    %rax,%rcx
L158:
  cmp    %rcx,%rsp
  je     L361
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L158
L361:
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  mov    %rdx,%rax
  and    $0xfff,%eax
  test   %rax,%rax
  je     L320
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L320:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0xa8(%rbp)
  mov    -0xdc(%rbp),%edx
  movslq %edx,%rax
  sub    $0x1,%rax
  mov    %rax,-0xa0(%rbp)
  movslq %edx,%rax
  mov    %rax,-0x120(%rbp)
  movq   $0x0,-0x118(%rbp)
  movslq %edx,%rax
  mov    %rax,-0x130(%rbp)
  movq   $0x0,-0x128(%rbp)
  movslq %edx,%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rdx
  mov    %rdx,%rax
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rcx
  sub    %rax,%rcx
L307:
  cmp    %rcx,%rsp
  je     L154
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L307
L154:
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  mov    %rdx,%rax
  and    $0xfff,%eax
  test   %rax,%rax
  je     L32
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L32:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x98(%rbp)
  mov    -0xec(%rbp),%eax
  sub    $0x1,%eax
  lea    (%rax,%rax,1),%edx
  mov    -0xdc(%rbp),%eax
  add    %eax,%edx
  movslq %edx,%rax
  sub    $0x1,%rax
  mov    %rax,-0x90(%rbp)
  movslq %edx,%rax
  mov    %rax,-0x140(%rbp)
  movq   $0x0,-0x138(%rbp)
  movslq %edx,%rax
  mov    %rax,-0x150(%rbp)
  movq   $0x0,-0x148(%rbp)
  movslq %edx,%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rdx
  mov    %rdx,%rax
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rcx
  sub    %rax,%rcx
L50:
  cmp    %rcx,%rsp
  je     L178
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L50
L178:
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  mov    %rdx,%rax
  and    $0xfff,%eax
  test   %rax,%rax
  je     L202
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L202:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x88(%rbp)
  mov    0x10(%rbp),%eax
  add    %eax,%eax
  sub    $0x1,%eax
  mov    %eax,-0xc4(%rbp)
  mov    -0xc4(%rbp),%edx
  movslq %edx,%rax
  sub    $0x1,%rax
  mov    %rax,-0x80(%rbp)
  movslq %edx,%rax
  mov    %rax,-0x160(%rbp)
  movq   $0x0,-0x158(%rbp)
  movslq %edx,%rax
  mov    %rax,-0x170(%rbp)
  movq   $0x0,-0x168(%rbp)
  movslq %edx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rdx
  mov    %rdx,%rax
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rcx
  sub    %rax,%rcx
L95:
  cmp    %rcx,%rsp
  je     L313
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L95
L313:
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  mov    %rdx,%rax
  and    $0xfff,%eax
  test   %rax,%rax
  je     L315
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L315:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x78(%rbp)
  mov    -0xc4(%rbp),%edx
  movslq %edx,%rax
  sub    $0x1,%rax
  mov    %rax,-0x70(%rbp)
  movslq %edx,%rax
  mov    %rax,-0x180(%rbp)
  movq   $0x0,-0x178(%rbp)
  movslq %edx,%rax
  mov    %rax,-0x190(%rbp)
  movq   $0x0,-0x188(%rbp)
  movslq %edx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L174:
  cmp    %rdx,%rsp
  je     L362
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L174
L362:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L210
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L210:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x68(%rbp)
  mov    -0xe0(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x60(%rbp)
  movslq %eax,%rdx
  mov    %rdx,-0x1a0(%rbp)
  movq   $0x0,-0x198(%rbp)
  movslq %eax,%rdx
  mov    %rdx,-0x1b0(%rbp)
  movq   $0x0,-0x1a8(%rbp)
  cltq
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L124:
  cmp    %rdx,%rsp
  je     L79
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L124
L79:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L229
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L229:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x58(%rbp)
  mov    0x10(%rbp),%eax
  sub    $0x1,%eax
  lea    (%rax,%rax,1),%edx
  mov    -0xe0(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x50(%rbp)
  movslq %eax,%rdx
  mov    %rdx,-0x1c0(%rbp)
  movq   $0x0,-0x1b8(%rbp)
  movslq %eax,%rdx
  mov    %rdx,-0x1d0(%rbp)
  movq   $0x0,-0x1c8(%rbp)
  cltq
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L311:
  cmp    %rdx,%rsp
  je     L195
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L311
L195:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L253
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L253:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x48(%rbp)
  mov    -0xf8(%rbp),%rax
  mov    -0xdc(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x100(%rbp),%rax
  mov    -0xe0(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0xec(%rbp),%edx
  mov    -0xa8(%rbp),%rcx
  mov    -0xb8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <build_downsample_pixelprop_table@plt>
  mov    -0x68(%rbp),%rcx
  mov    -0x78(%rbp),%rax
  mov    0x10(%rbp),%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <build_downsample_pixelprop_table@plt>
  mov    -0xe8(%rbp),%ecx
  mov    -0xe0(%rbp),%eax
  mov    0x10(%rbp),%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <return_downscaled_array_len@plt>
  mov    -0x100(%rbp),%rdx
  mov    %eax,(%rdx)
  cmpl   $0x1,0x10(%rbp)
  jne    L326
  cmpl   $0x0,-0xe8(%rbp)
  je     L31
L326:
  movl   $0x0,-0xd0(%rbp)
  jmp    L345
L327:
  mov    -0xd0(%rbp),%eax
  movslq %eax,%rdx
  mov    -0xd8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x40(%rbp)
  mov    0x10(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x40(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%ecx
  mov    -0x48(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    0x10(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0xe0(%rbp),%eax
  sub    $0x1,%eax
  imul   -0xdc(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    0x10(%rbp),%ecx
  movslq %ecx,%rsi
  mov    -0xe0(%rbp),%ecx
  movslq %ecx,%rcx
  add    %rsi,%rcx
  lea    -0x1(%rcx),%rsi
  mov    -0x48(%rbp),%rcx
  add    %rsi,%rcx
  mov    %eax,%esi
  mov    %rcx,%rdi
  call   <memset@plt>
  movl   $0x0,-0xcc(%rbp)
  jmp    L135
L101:
  mov    -0xdc(%rbp),%eax
  imul   -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    0x10(%rbp),%edx
  movslq %edx,%rcx
  mov    -0xcc(%rbp),%edx
  movslq %edx,%rdx
  add    %rcx,%rdx
  lea    -0x1(%rdx),%rcx
  mov    -0x48(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0xcc(%rbp)
L135:
  mov    -0xcc(%rbp),%eax
  cmp    -0xe0(%rbp),%eax
  jl     L101
  mov    0x10(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x48(%rbp),%rax
  lea    (%rdx,%rax,1),%rdi
  mov    -0xc4(%rbp),%esi
  mov    -0xe8(%rbp),%ecx
  mov    -0xe0(%rbp),%edx
  mov    -0x58(%rbp),%rax
  push   -0x68(%rbp)
  push   -0x78(%rbp)
  mov    %esi,%r9d
  mov    0x10(%rbp),%r8d
  mov    %rax,%rsi
  call   <downsample_component_line@plt>
  add    $0x10,%rsp
  movl   $0x0,-0xcc(%rbp)
  jmp    L260
L305:
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0xdc(%rbp),%eax
  imul   -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x40(%rbp),%rax
  add    %rax,%rdx
  movzbl (%rcx),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0xcc(%rbp)
L260:
  mov    -0x100(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0xcc(%rbp)
  jl     L305
  addl   $0x1,-0xd0(%rbp)
L345:
  mov    -0xd0(%rbp),%eax
  cmp    -0xdc(%rbp),%eax
  jl     L327
L31:
  mov    -0xec(%rbp),%edx
  mov    -0xe4(%rbp),%ecx
  mov    -0xdc(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <return_downscaled_array_len@plt>
  mov    -0xf8(%rbp),%rdx
  mov    %eax,(%rdx)
  cmpl   $0x1,-0xec(%rbp)
  jne    L14
  cmpl   $0x0,-0xe4(%rbp)
  je     L71
L14:
  movl   $0x0,-0xd0(%rbp)
  jmp    L268
L352:
  mov    -0xd0(%rbp),%eax
  imul   -0xdc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0xd8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x40(%rbp)
  mov    -0xec(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x40(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%ecx
  mov    -0x88(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0xec(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0xdc(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0xec(%rbp),%ecx
  movslq %ecx,%rsi
  mov    -0xdc(%rbp),%ecx
  movslq %ecx,%rcx
  add    %rsi,%rcx
  lea    -0x1(%rcx),%rsi
  mov    -0x88(%rbp),%rcx
  add    %rsi,%rcx
  mov    %eax,%esi
  mov    %rcx,%rdi
  call   <memset@plt>
  mov    -0xec(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x88(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0xdc(%rbp),%edx
  mov    -0x40(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0xec(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x88(%rbp),%rax
  lea    (%rdx,%rax,1),%rdi
  mov    -0xc8(%rbp),%r8d
  mov    -0xec(%rbp),%esi
  mov    -0xe4(%rbp),%ecx
  mov    -0xdc(%rbp),%edx
  mov    -0x98(%rbp),%rax
  push   -0xa8(%rbp)
  push   -0xb8(%rbp)
  mov    %r8d,%r9d
  mov    %esi,%r8d
  mov    %rax,%rsi
  call   <downsample_component_line@plt>
  add    $0x10,%rsp
  mov    -0xf8(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x98(%rbp),%rcx
  mov    -0x40(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  addl   $0x1,-0xd0(%rbp)
L268:
  mov    -0x100(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0xd0(%rbp)
  jl     L352
L71:
  mov    %rbx,%rsp
  nop
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L166
  call   <__stack_chk_fail@plt>
L166:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

assistant: ```c
void downsample_component(unsigned char *carray, int width, int height, const int xpos, const int ypos, const int xstep, const int ystep, int *out_width, int *out_height) {
  int x_pixel_len = (xstep * 2) - 1;
  int x_pixel_coord[x_pixel_len];
  float x_pixel_percent[x_pixel_len];
  unsigned char x_out_buff[width];
  unsigned char x_in_buff[width + (xstep - 1) * 2];
  int y_pixel_len = (ystep * 2) - 1;
  int y_pixel_coord[y_pixel_len];
  float y_pixel_percent[y_pixel_len];
  unsigned char y_out_buff[height];
  unsigned char y_in_buff[height + (ystep - 1) * 2];
  int linecount;
  unsigned char *datastart;
  int i;
  *out_width = width;
  *out_height = height;
  build_downsample_pixelprop_table(x_pixel_coord, x_pixel_percent, xstep);
  build_downsample_pixelprop_table(y_pixel_coord, y_pixel_percent, ystep);
  *out_height = return_downscaled_array_len(height, ypos, ystep);
  if ((ystep != 1) || (ypos != 0)) {
    for (linecount = 0; linecount < width; linecount++) {
      datastart = carray + linecount;
      memset(y_in_buff, *datastart, ystep - 1);
      memset((y_in_buff + ystep - 1 + height), *(datastart + ((height - 1) * width)), ystep - 1);
      for (i = 0; i < height; i++)
        *(y_in_buff + (ystep - 1) + i) = *(datastart + (width * i));
      downsample_component_line(y_in_buff + (ystep - 1), y_out_buff, height, ypos, ystep, y_pixel_len, y_pixel_coord, y_pixel_percent);
      for (i = 0; i < *out_height; i++)
        *(datastart + (width * i)) = *(y_out_buff + i);
    }
  }
  *out_width = return_downscaled_array_len(width, xpos, xstep);
  if ((xstep != 1) || (xpos != 0)) {
    for (linecount = 0; linecount < *out_height; linecount++) {
      datastart = carray + (linecount * width);
      memset(x_in_buff, *datastart, xstep - 1);
      memset((x_in_buff + xstep - 1 + width), *(datastart + (width - 1)), xstep - 1);
      memcpy(x_in_buff + (xstep - 1), datastart, width);
      downsample_component_line(x_in_buff + (xstep - 1), x_out_buff, width, xpos, xstep, x_pixel_len, x_pixel_coord, x_pixel_percent);
      memcpy(datastart, x_out_buff, *out_width);
    }
  }
}
```