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

```asm
<Subsample_Horizontal>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    0x38(%rsp),%r12d
  mov    0x48(%rsp),%r15d
  mov    %rdi,-0x18(%rsp)
  test   %ecx,%ecx
  jle    L94
  mov    %r15d,%ebx
  lea    -0x1(%r8),%edi
  mov    %edx,%ebp
  mov    %rsi,%rax
  sar    %ebx
  mov    %edi,-0xc(%rsp)
  mov    %ecx,%edx
  mov    %ebx,-0x10(%rsp)
  movslq %r8d,%rbx
  add    %rbx,%rbx
  cmp    $0x1,%r8d
  jne    L85
  cmp    $0x1,%r9d
  jne    L85
  lea    -0x1(%r12),%r14d
  lea    -0x1(%rcx),%eax
  imul   0x40(%rsp),%ebp
  lea    0x2(%rsi,%r14,1),%r13
  lea    0x1(%rsi,%r14,1),%r9
  add    %rax,%r13
  nopl   0x0(%rax)
L133:
  mov    %ebp,%eax
  mov    -0x18(%rsp),%rdi
  mov    %r9,%rsi
  mov    $0x10,%r11d
  cltd
  sub    %r14,%rsi
  idiv   %r15d
  sub    $0x1,%rsi
  movslq %eax,%rcx
  test   %eax,%eax
  mov    -0x10(%rsp),%eax
  lea    (%rdi,%rcx,2),%r10
  lea    0x2(%r10),%r8
  cmovns %r10,%r8
  shl    $0x4,%edx
  add    %edx,%eax
  cltd
  idiv   %r15d
  sub    %eax,%r11d
  test   %r12d,%r12d
  jle    L10
  xor    %edi,%edi
  jmp    L111
  nopl   (%rax)
L49:
  sub    $0xffffff80,%edx
  add    $0x1,%rsi
  add    %rbx,%rdi
  mov    %dh,-0x1(%rsi)
  cmp    %r9,%rsi
  je     L10
L111:
  movswl (%r10,%rdi,1),%edx
  movswl (%r8,%rdi,1),%ecx
  imul   %r11d,%edx
  imul   %eax,%ecx
  add    %ecx,%edx
  jns    L49
  add    $0x7f,%edx
  add    $0x1,%rsi
  add    %rbx,%rdi
  mov    %dh,-0x1(%rsi)
  cmp    %r9,%rsi
  jne    L111
L10:
  add    $0x1,%r9
  add    0x40(%rsp),%ebp
  cmp    %r9,%r13
  jne    L133
L94:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L85:
  mov    0x40(%rsp),%r14d
  movslq %r9d,%r9
  imul   %ebp,%r14d
  mov    %rax,%rbp
  lea    -0x1(%rdx),%eax
  lea    0x1(%rbp,%rax,1),%rax
  mov    %rax,-0x8(%rsp)
  nopl   0x0(%rax)
L141:
  mov    %r14d,%eax
  mov    -0x18(%rsp),%rdi
  mov    $0x10,%r13d
  mov    %rbp,%r8
  cltd
  idiv   %r15d
  cmp    -0xc(%rsp),%eax
  movslq %eax,%rcx
  mov    -0x10(%rsp),%eax
  lea    (%rdi,%rcx,2),%r11
  lea    0x2(%r11),%r10
  cmovge %r11,%r10
  shl    $0x4,%edx
  xor    %esi,%esi
  xor    %edi,%edi
  add    %edx,%eax
  cltd
  idiv   %r15d
  sub    %eax,%r13d
  test   %r12d,%r12d
  jg     L0
  jmp    L43
  nopl   0x0(%rax,%rax,1)
L5:
  sub    $0xffffff80,%edx
L79:
  movzbl %dh,%ecx
  add    $0x1,%edi
  add    %rbx,%rsi
  mov    %cl,(%r8)
  add    %r9,%r8
  cmp    %edi,%r12d
  je     L43
L0:
  movswl (%r11,%rsi,1),%edx
  movswl (%r10,%rsi,1),%ecx
  imul   %r13d,%edx
  imul   %eax,%ecx
  add    %ecx,%edx
  jns    L5
  add    $0x7f,%edx
  jmp    L79
  nopl   0x0(%rax)
L43:
  add    0x40(%rsp),%r14d
  add    $0x1,%rbp
  cmp    %rbp,-0x8(%rsp)
  jne    L141
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void Subsample_Horizontal(signed short int *s, unsigned char *d, signed int x0, signed int lx, signed int lxs, signed int lxd, signed int ly, signed int m, signed int n) {
  signed int i;
  signed int i1;
  signed int j;
  signed int id;
  signed int c1;
  signed int c2;
  signed int v;
  signed short int *s1;
  signed short int *s2;
  unsigned char *d1;
  i1 = 0;
  while (!(i1 >= lx)) {
    d1 = d + (signed long int)i1;
    i = x0 + i1;
    id = (i * m) / n;
    s1 = s + (signed long int)id;
    s2 = id < lxs - 1 ? s1 + (signed long int)1 : s1;
    c2 = (16 * ((i * m) % n) + (n >> 1)) / n;
    c1 = 16 - c2;
    j = 0;
    while (!(j >= ly)) {
      v = c1 * (signed int)*s1 + c2 * (signed int)*s2;
      *d1 = (unsigned char)(v + (v >= 0 ? 128 : 127) >> 8);
      d1 = d1 + (signed long int)lxd;
      s1 = s1 + (signed long int)lxs;
      s2 = s2 + (signed long int)lxs;
      j = j + 1;
    }
    i1 = i1 + 1;
  }
}
```