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

```asm
<runor>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x4000(%rsp),%r11
L240:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L240
  sub    $0x10,%rsp
  mov    %rdi,%r11
  mov    %esi,%ebx
  mov    %rdx,%rbp
  mov    %ecx,%r12d
  mov    %fs:0x28,%rax
  mov    %rax,0x4008(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rax
  test   %r8,%r8
  cmove  %rax,%r8
  movzwl (%rdi),%edi
  movzwl (%rdx),%esi
  movw   $0x0,(%r8)
  mov    $0x0,%eax
  mov    $0x0,%ecx
  mov    $0x0,%edx
  jmp    L146
L171:
  movslq %eax,%r10
  add    %di,(%r8,%r10,2)
L95:
  sub    %edi,%esi
  add    $0x1,%edx
  cmp    %ebx,%edx
  jge    L182
  movslq %edx,%rdi
  movzwl (%r11,%rdi,2),%edi
L146:
  cmp    %si,%di
  jg     L36
  mov    %edx,%r10d
  or     %ecx,%r10d
  xor    %eax,%r10d
  test   $0x1,%r10b
  je     L171
  add    $0x1,%eax
  movslq %eax,%r10
  mov    %di,(%r8,%r10,2)
  jmp    L95
L36:
  mov    %edx,%r10d
  or     %ecx,%r10d
  xor    %eax,%r10d
  test   $0x1,%r10b
  je     L151
  add    $0x1,%eax
  movslq %eax,%r10
  mov    %si,(%r8,%r10,2)
L55:
  sub    %esi,%edi
  add    $0x1,%ecx
  cmp    %r12d,%ecx
  jge    L159
  movslq %ecx,%rsi
  movzwl 0x0(%rbp,%rsi,2),%esi
  jmp    L146
L151:
  movslq %eax,%r10
  add    %si,(%r8,%r10,2)
  jmp    L55
L159:
  cmp    %ebx,%edx
  jge    L182
  movslq %edx,%rdx
  jmp    L6
L19:
  movslq %eax,%rcx
  add    %di,(%r8,%rcx,2)
L11:
  add    $0x1,%rdx
  cmp    %edx,%ebx
  jle    L111
  movzwl (%r11,%rdx,2),%edi
L6:
  mov    %eax,%ecx
  xor    %edx,%ecx
  test   $0x1,%cl
  je     L19
  add    $0x1,%eax
  movslq %eax,%rcx
  mov    %di,(%r8,%rcx,2)
  jmp    L11
L182:
  movslq %ecx,%rcx
  jmp    L139
L162:
  movslq %eax,%rdx
  add    %si,(%r8,%rdx,2)
L119:
  add    $0x1,%rcx
  cmp    %ecx,%r12d
  jle    L111
  movzwl 0x0(%rbp,%rcx,2),%esi
L139:
  mov    %eax,%edx
  xor    %ecx,%edx
  test   $0x1,%dl
  je     L162
  add    $0x1,%eax
  movslq %eax,%rdx
  mov    %si,(%r8,%rdx,2)
  jmp    L119
L111:
  mov    %rsp,%rdx
  mov    $0x0,%esi
  cmp    %rdx,%r8
  je     L46
L70:
  test   %r9,%r9
  je     L124
  mov    %esi,(%r9)
L124:
  add    $0x1,%eax
  mov    0x4008(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L128
  add    $0x4010,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L46:
  test   %eax,%eax
  js     L67
  lea    0x1(%rax),%edi
  add    %rdi,%rdi
  mov    $0x0,%edx
L99:
  movzwl (%rsp,%rdx,1),%ecx
  mov    %cx,(%r11,%rdx,1)
  movswl %cx,%ecx
  add    %ecx,%esi
  add    $0x2,%rdx
  cmp    %rdi,%rdx
  jne    L99
  jmp    L70
L67:
  mov    $0x0,%esi
  jmp    L70
L128:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int runor(short *a, int na, short *b, int nb, short *c, int *pels) {
  register short la, lb;
  int ia, ib, ic, np = 0;
  short tmp[8192];
  if (!c)
    c = tmp;
  la = a[ia = 0];
  lb = b[ib = 0];
  c[ic = 0] = 0;
  while (1) {
    if (la <= lb) {
      if (((ia | ib) ^ ic) & 1)
        c[++ic] = la;
      else
        c[ic] += la;
      lb -= la;
      if (++ia >= na)
        break;
      la = a[ia];
    } else {
      if (((ia | ib) ^ ic) & 1)
        c[++ic] = lb;
      else
        c[ic] += lb;
      la -= lb;
      if (++ib >= nb)
        break;
      lb = b[ib];
    }
  }
  if (ia < na)
    while (1) {
      if ((ia ^ ic) & 1)
        c[++ic] = la;
      else
        c[ic] += la;
      if (++ia >= na)
        break;
      la = a[ia];
    }
  else
    while (1) {
      if ((ib ^ ic) & 1)
        c[++ic] = lb;
      else
        c[ic] += lb;
      if (++ib >= nb)
        break;
      lb = b[ib];
    }
  if (c == tmp)
    for (ia = 0; ia <= ic; ia++)
      np += a[ia] = c[ia];
  if (pels)
    *pels = np;
  return ic + 1;
}
```