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

```asm
<linear_img>:
  endbr64
  push   %rbx
  mov    %ecx,%r10d
  mov    0x18(%rsp),%ecx
  test   %ecx,%ecx
  jle    L250
  lea    0x2(%rsi),%r11
  mov    %rdx,%rax
  mov    0x10(%rsp),%ebx
  sub    %r11,%rax
  cmp    $0xc,%rax
  lea    -0x1(%rcx),%eax
  seta   %r11b
  cmp    $0x6,%eax
  seta   %al
  test   %ebx,%ebx
  jne    L265
  test   %al,%r11b
  je     L221
  lea    0x2(%rdi),%r11
  mov    %rdx,%rax
  sub    %r11,%rax
  cmp    $0xc,%rax
  jbe    L221
  movd   %r10d,%xmm5
  movd   %r9d,%xmm6
  mov    %ecx,%r11d
  xor    %eax,%eax
  pshufd $0x0,%xmm5,%xmm4
  shr    $0x3,%r11d
  movd   %r8d,%xmm5
  pshufd $0x0,%xmm6,%xmm8
  pshufd $0x0,%xmm5,%xmm2
  movdqa %xmm4,%xmm7
  shl    $0x4,%r11
  pxor   %xmm5,%xmm5
  movdqa %xmm2,%xmm6
  movdqa D3(%rip),%xmm3
  psrlq  $0x20,%xmm7
  pxor   %xmm1,%xmm1
  psrlq  $0x20,%xmm6
  cs nopw 0x0(%rax,%rax,1)
L117:
  movdqu (%rdi,%rax,1),%xmm9
  movdqa %xmm5,%xmm13
  movdqu (%rsi,%rax,1),%xmm0
  movdqa %xmm5,%xmm12
  pcmpgtw %xmm9,%xmm13
  pcmpgtw %xmm0,%xmm12
  movdqa %xmm9,%xmm11
  punpcklwd %xmm13,%xmm11
  punpckhwd %xmm13,%xmm9
  movdqa %xmm11,%xmm10
  psrlq  $0x20,%xmm11
  pmuludq %xmm4,%xmm10
  pmuludq %xmm7,%xmm11
  pshufd $0x8,%xmm10,%xmm10
  pshufd $0x8,%xmm11,%xmm11
  punpckldq %xmm11,%xmm10
  movdqa %xmm0,%xmm11
  punpckhwd %xmm12,%xmm0
  punpcklwd %xmm12,%xmm11
  movdqa %xmm11,%xmm14
  psrlq  $0x20,%xmm11
  pmuludq %xmm2,%xmm14
  pmuludq %xmm6,%xmm11
  pshufd $0x8,%xmm14,%xmm14
  pshufd $0x8,%xmm11,%xmm11
  punpckldq %xmm11,%xmm14
  movdqa %xmm9,%xmm11
  psrlq  $0x20,%xmm9
  pmuludq %xmm4,%xmm11
  paddd  %xmm14,%xmm10
  pmuludq %xmm7,%xmm9
  paddd  %xmm8,%xmm10
  pshufd $0x8,%xmm11,%xmm11
  pshufd $0x8,%xmm9,%xmm9
  punpckldq %xmm9,%xmm11
  movdqa %xmm0,%xmm9
  psrlq  $0x20,%xmm0
  pmuludq %xmm2,%xmm9
  pmuludq %xmm6,%xmm0
  pshufd $0x8,%xmm9,%xmm9
  pshufd $0x8,%xmm0,%xmm0
  punpckldq %xmm0,%xmm9
  movdqa %xmm1,%xmm0
  paddd  %xmm9,%xmm11
  movdqa %xmm1,%xmm9
  psubd  %xmm10,%xmm0
  pcmpgtd %xmm10,%xmm9
  paddd  %xmm8,%xmm11
  pand   %xmm9,%xmm0
  pandn  %xmm10,%xmm9
  movdqa %xmm1,%xmm10
  pcmpgtd %xmm11,%xmm10
  por    %xmm0,%xmm9
  movdqa %xmm1,%xmm0
  psubd  %xmm11,%xmm0
  pand   %xmm10,%xmm0
  pandn  %xmm11,%xmm10
  movdqa %xmm3,%xmm11
  por    %xmm0,%xmm10
  movdqa %xmm9,%xmm0
  pcmpgtd %xmm3,%xmm0
  pand   %xmm0,%xmm11
  pandn  %xmm9,%xmm0
  movdqa %xmm10,%xmm9
  pcmpgtd %xmm3,%xmm9
  por    %xmm11,%xmm0
  movdqa %xmm3,%xmm11
  pand   %xmm9,%xmm11
  pandn  %xmm10,%xmm9
  movdqa %xmm0,%xmm10
  por    %xmm11,%xmm9
  punpcklwd %xmm9,%xmm0
  punpckhwd %xmm9,%xmm10
  movdqa %xmm0,%xmm9
  punpcklwd %xmm10,%xmm0
  punpckhwd %xmm10,%xmm9
  punpcklwd %xmm9,%xmm0
  movups %xmm0,(%rdx,%rax,1)
  add    $0x10,%rax
  cmp    %r11,%rax
  jne    L117
  mov    %ecx,%r11d
  and    $0xfffffff8,%r11d
  mov    %r11d,%eax
  add    %rax,%rax
  add    %rax,%rdi
  add    %rax,%rsi
  add    %rdx,%rax
  cmp    %r11d,%ecx
  je     L250
  movswl (%rsi),%edx
  movswl (%rdi),%ebx
  imul   %r8d,%edx
  imul   %r10d,%ebx
  add    %ebx,%edx
  add    %r9d,%edx
  mov    %edx,%ebx
  neg    %ebx
  cmovns %ebx,%edx
  mov    $0xfff,%ebx
  cmp    %ebx,%edx
  cmovg  %ebx,%edx
  mov    %dx,(%rax)
  lea    0x1(%r11),%edx
  cmp    %ecx,%edx
  jge    L250
  movswl 0x2(%rdi),%edx
  movswl 0x2(%rsi),%ebx
  imul   %r10d,%edx
  imul   %r8d,%ebx
  add    %ebx,%edx
  add    %r9d,%edx
  mov    %edx,%ebx
  neg    %ebx
  cmovns %ebx,%edx
  mov    $0xfff,%ebx
  cmp    %ebx,%edx
  cmovg  %ebx,%edx
  mov    %dx,0x2(%rax)
  lea    0x2(%r11),%edx
  cmp    %edx,%ecx
  jle    L250
  movswl 0x4(%rdi),%edx
  movswl 0x4(%rsi),%ebx
  imul   %r10d,%edx
  imul   %r8d,%ebx
  add    %ebx,%edx
  add    %r9d,%edx
  mov    %edx,%ebx
  neg    %ebx
  cmovns %ebx,%edx
  mov    $0xfff,%ebx
  cmp    %ebx,%edx
  cmovg  %ebx,%edx
  mov    %dx,0x4(%rax)
  lea    0x3(%r11),%edx
  cmp    %edx,%ecx
  jle    L250
  movswl 0x6(%rdi),%edx
  movswl 0x6(%rsi),%ebx
  imul   %r10d,%edx
  imul   %r8d,%ebx
  add    %ebx,%edx
  add    %r9d,%edx
  mov    %edx,%ebx
  neg    %ebx
  cmovns %ebx,%edx
  mov    $0xfff,%ebx
  cmp    %ebx,%edx
  cmovg  %ebx,%edx
  mov    %dx,0x6(%rax)
  lea    0x4(%r11),%edx
  cmp    %edx,%ecx
  jle    L250
  movswl 0x8(%rdi),%edx
  movswl 0x8(%rsi),%ebx
  imul   %r10d,%edx
  imul   %r8d,%ebx
  add    %ebx,%edx
  add    %r9d,%edx
  mov    %edx,%ebx
  neg    %ebx
  cmovns %ebx,%edx
  mov    $0xfff,%ebx
  cmp    %ebx,%edx
  cmovg  %ebx,%edx
  mov    %dx,0x8(%rax)
  lea    0x5(%r11),%edx
  cmp    %edx,%ecx
  jle    L250
  movswl 0xa(%rdi),%edx
  movswl 0xa(%rsi),%ebx
  imul   %r10d,%edx
  imul   %r8d,%ebx
  add    %ebx,%edx
  add    %r9d,%edx
  mov    %edx,%ebx
  neg    %ebx
  cmovns %ebx,%edx
  mov    $0xfff,%ebx
  cmp    %ebx,%edx
  cmovg  %ebx,%edx
  add    $0x6,%r11d
  mov    %dx,0xa(%rax)
  cmp    %r11d,%ecx
  jle    L250
  movswl 0xc(%rdi),%edx
  movswl 0xc(%rsi),%ecx
  imul   %r10d,%edx
  imul   %r8d,%ecx
  add    %ecx,%edx
  add    %r9d,%edx
  mov    %edx,%ecx
  neg    %ecx
  cmovns %ecx,%edx
  mov    $0xfff,%ecx
  cmp    %ecx,%edx
  cmovg  %ecx,%edx
  mov    %dx,0xc(%rax)
L250:
  pop    %rbx
  ret
  xchg   %ax,%ax
L265:
  test   %al,%r11b
  je     L161
  lea    0x2(%rdi),%r11
  mov    %rdx,%rax
  sub    %r11,%rax
  cmp    $0xc,%rax
  jbe    L161
  movd   %r10d,%xmm4
  movd   %r8d,%xmm7
  mov    %ecx,%r11d
  xor    %eax,%eax
  pshufd $0x0,%xmm4,%xmm5
  pshufd $0x0,%xmm7,%xmm4
  movd   %r9d,%xmm6
  shr    $0x3,%r11d
  movdqa %xmm5,%xmm9
  movdqa %xmm4,%xmm8
  pshufd $0x0,%xmm6,%xmm10
  movdqa D3(%rip),%xmm3
  shl    $0x4,%r11
  psrlq  $0x20,%xmm9
  pxor   %xmm7,%xmm7
  psrlq  $0x20,%xmm8
  pxor   %xmm6,%xmm6
  nop
L77:
  movdqu (%rdi,%rax,1),%xmm1
  movdqa %xmm7,%xmm13
  movdqu (%rsi,%rax,1),%xmm0
  movdqa %xmm7,%xmm12
  pcmpgtw %xmm1,%xmm13
  pcmpgtw %xmm0,%xmm12
  movdqa %xmm1,%xmm11
  punpcklwd %xmm13,%xmm11
  punpckhwd %xmm13,%xmm1
  movdqa %xmm11,%xmm2
  psrlq  $0x20,%xmm11
  pmuludq %xmm5,%xmm2
  pmuludq %xmm9,%xmm11
  pshufd $0x8,%xmm2,%xmm2
  pshufd $0x8,%xmm11,%xmm11
  punpckldq %xmm11,%xmm2
  movdqa %xmm0,%xmm11
  punpckhwd %xmm12,%xmm0
  punpcklwd %xmm12,%xmm11
  movdqa %xmm11,%xmm14
  psrlq  $0x20,%xmm11
  pmuludq %xmm4,%xmm14
  pmuludq %xmm8,%xmm11
  pshufd $0x8,%xmm14,%xmm14
  pshufd $0x8,%xmm11,%xmm11
  punpckldq %xmm11,%xmm14
  movdqa %xmm1,%xmm11
  psrlq  $0x20,%xmm1
  pmuludq %xmm5,%xmm11
  paddd  %xmm14,%xmm2
  pmuludq %xmm9,%xmm1
  paddd  %xmm10,%xmm2
  pshufd $0x8,%xmm11,%xmm11
  pshufd $0x8,%xmm1,%xmm1
  punpckldq %xmm1,%xmm11
  movdqa %xmm0,%xmm1
  psrlq  $0x20,%xmm0
  pmuludq %xmm4,%xmm1
  pmuludq %xmm8,%xmm0
  pshufd $0x8,%xmm1,%xmm1
  pshufd $0x8,%xmm0,%xmm0
  punpckldq %xmm0,%xmm1
  movdqa %xmm2,%xmm0
  pcmpgtd %xmm3,%xmm0
  paddd  %xmm1,%xmm11
  movdqa %xmm3,%xmm1
  paddd  %xmm10,%xmm11
  pand   %xmm0,%xmm1
  pandn  %xmm2,%xmm0
  por    %xmm0,%xmm1
  movdqa %xmm6,%xmm0
  pcmpgtd %xmm2,%xmm0
  movdqa %xmm3,%xmm2
  pandn  %xmm1,%xmm0
  movdqa %xmm11,%xmm1
  pcmpgtd %xmm3,%xmm1
  pand   %xmm1,%xmm2
  pandn  %xmm11,%xmm1
  por    %xmm2,%xmm1
  movdqa %xmm6,%xmm2
  pcmpgtd %xmm11,%xmm2
  pandn  %xmm1,%xmm2
  movdqa %xmm0,%xmm1
  punpcklwd %xmm2,%xmm0
  punpckhwd %xmm2,%xmm1
  movdqa %xmm0,%xmm2
  punpcklwd %xmm1,%xmm0
  punpckhwd %xmm1,%xmm2
  punpcklwd %xmm2,%xmm0
  movups %xmm0,(%rdx,%rax,1)
  add    $0x10,%rax
  cmp    %r11,%rax
  jne    L77
  mov    %ecx,%r11d
  and    $0xfffffff8,%r11d
  mov    %r11d,%eax
  add    %rax,%rax
  add    %rax,%rdi
  add    %rax,%rsi
  add    %rax,%rdx
  cmp    %r11d,%ecx
  je     L250
  movswl (%rdi),%eax
  movswl (%rsi),%ebx
  imul   %r10d,%eax
  imul   %r8d,%ebx
  add    %ebx,%eax
  mov    $0xfff,%ebx
  add    %r9d,%eax
  cmp    %ebx,%eax
  cmovg  %ebx,%eax
  xor    %ebx,%ebx
  test   %eax,%eax
  cmovs  %ebx,%eax
  mov    %ax,(%rdx)
  lea    0x1(%r11),%eax
  cmp    %eax,%ecx
  jle    L250
  movswl 0x2(%rdi),%eax
  movswl 0x2(%rsi),%ebx
  imul   %r10d,%eax
  imul   %r8d,%ebx
  add    %ebx,%eax
  mov    $0xfff,%ebx
  add    %r9d,%eax
  cmp    %ebx,%eax
  cmovg  %ebx,%eax
  xor    %ebx,%ebx
  test   %eax,%eax
  cmovs  %ebx,%eax
  mov    %ax,0x2(%rdx)
  lea    0x2(%r11),%eax
  cmp    %eax,%ecx
  jle    L250
  movswl 0x4(%rdi),%eax
  movswl 0x4(%rsi),%ebx
  imul   %r10d,%eax
  imul   %r8d,%ebx
  add    %ebx,%eax
  mov    $0xfff,%ebx
  add    %r9d,%eax
  cmp    %ebx,%eax
  cmovg  %ebx,%eax
  xor    %ebx,%ebx
  test   %eax,%eax
  cmovs  %ebx,%eax
  mov    %ax,0x4(%rdx)
  lea    0x3(%r11),%eax
  cmp    %eax,%ecx
  jle    L250
  movswl 0x6(%rdi),%eax
  movswl 0x6(%rsi),%ebx
  imul   %r10d,%eax
  imul   %r8d,%ebx
  add    %ebx,%eax
  mov    $0xfff,%ebx
  add    %r9d,%eax
  cmp    %ebx,%eax
  cmovg  %ebx,%eax
  xor    %ebx,%ebx
  test   %eax,%eax
  cmovs  %ebx,%eax
  mov    %ax,0x6(%rdx)
  lea    0x4(%r11),%eax
  cmp    %eax,%ecx
  jle    L250
  movswl 0x8(%rdi),%eax
  movswl 0x8(%rsi),%ebx
  imul   %r10d,%eax
  imul   %r8d,%ebx
  add    %ebx,%eax
  mov    $0xfff,%ebx
  add    %r9d,%eax
  cmp    %ebx,%eax
  cmovg  %ebx,%eax
  xor    %ebx,%ebx
  test   %eax,%eax
  cmovs  %ebx,%eax
  mov    %ax,0x8(%rdx)
  lea    0x5(%r11),%eax
  cmp    %eax,%ecx
  jle    L250
  movswl 0xa(%rdi),%eax
  movswl 0xa(%rsi),%ebx
  imul   %r10d,%eax
  imul   %r8d,%ebx
  add    %ebx,%eax
  mov    $0xfff,%ebx
  add    %r9d,%eax
  cmp    %ebx,%eax
  cmovg  %ebx,%eax
  xor    %ebx,%ebx
  test   %eax,%eax
  cmovs  %ebx,%eax
  add    $0x6,%r11d
  mov    %ax,0xa(%rdx)
  cmp    %r11d,%ecx
  jle    L250
  movswl 0xc(%rdi),%eax
  movswl 0xc(%rsi),%ecx
  imul   %r10d,%eax
  imul   %r8d,%ecx
  add    %ecx,%eax
  mov    $0xfff,%ecx
  add    %r9d,%eax
  cmp    %ecx,%eax
  cmovg  %ecx,%eax
  xor    %ecx,%ecx
  test   %eax,%eax
  cmovs  %ecx,%eax
  mov    %ax,0xc(%rdx)
  pop    %rbx
  ret
L221:
  xor    %ebx,%ebx
L60:
  movswl (%rdi,%rbx,2),%eax
  movswl (%rsi,%rbx,2),%r11d
  imul   %r10d,%eax
  imul   %r8d,%r11d
  add    %r11d,%eax
  add    %r9d,%eax
  mov    %eax,%r11d
  neg    %r11d
  cmovns %r11d,%eax
  mov    $0xfff,%r11d
  cmp    %r11d,%eax
  cmovg  %r11d,%eax
  mov    %ax,(%rdx,%rbx,2)
  add    $0x1,%rbx
  cmp    %rbx,%rcx
  jne    L60
  pop    %rbx
  ret
L161:
  xor    %r11d,%r11d
L197:
  movswl (%rdi,%r11,2),%eax
  movswl (%rsi,%r11,2),%ebx
  imul   %r10d,%eax
  imul   %r8d,%ebx
  add    %ebx,%eax
  add    %r9d,%eax
  js     L80
  mov    $0xfff,%ebx
  cmp    %ebx,%eax
  cmovg  %ebx,%eax
  mov    %ax,(%rdx,%r11,2)
  add    $0x1,%r11
  cmp    %rcx,%r11
  jne    L197
  jmp    L250
  nopl   0x0(%rax,%rax,1)
L80:
  xor    %eax,%eax
  mov    %ax,(%rdx,%r11,2)
  add    $0x1,%r11
  cmp    %rcx,%r11
  jne    L197
  pop    %rbx
  ret
```

tool_calls: name: parse_data
arguments: tag: D3
type_guessed: byte[16]

tool: {"D3": [0xff,0x0f,0x00,0x00,0xff,0x0f,0x00,0x00,0xff,0x0f,0x00,0x00,0xff,0x0f,0x00,0x00]}

assistant: ```c
void linear_img(short int *src0, short int *src1, short int *dst, int c0, int c1, int c2, int ov_flag, int npix) {
  int i, res;
  for (i = 0; i < npix; ++i) {
    res = (*src0) * c0 + (*src1) * c1 + c2;
    if (res < 0) {
      if (ov_flag)
        res = 0;
      else
        res = (((res) > 0) ? ((res)) : (-(res)));
    }
    if (res > 4096 - 1)
      res = 4096 - 1;
    *dst = res;
    dst++;
    src0++;
    src1++;
  }
}
```