user: 请从给定的汇编指令推导出C源代码：

```asm
<imcd_xor>:
  endbr64
  mov    %rcx,%rax
  mov    0x8(%rsp),%rcx
  test   %rax,%rax
  sete   %r11b
  cmp    %rdi,%rax
  sete   %r10b
  or     %r10b,%r11b
  jne    L483
  cmp    %r8,%rsi
  mov    %r8,%r10
  cmovle %rsi,%r10
L275:
  or     %rsi,%r8
  js     L568
  test   %r10,%r10
  jle    L404
  cmp    $0x4,%rcx
  je     L496
  jg     L162
  cmp    $0x1,%rcx
  je     L527
  cmp    $0x2,%rcx
  jne    L568
  mov    0x10(%rsp),%esi
  mov    (%rdi),%ecx
  test   %esi,%esi
  jne    L435
  mov    %ecx,(%rax)
  cmp    $0x1,%r10
  je     L353
  mov    $0x1,%r8d
  nop
L549:
  add    %rdx,%rdi
  mov    %ecx,%esi
  add    %r9,%rax
  add    $0x1,%r8
  mov    (%rdi),%ecx
  xor    %ecx,%esi
  mov    %esi,(%rax)
  cmp    %r10,%r8
  jne    L549
  jmp    L353
  nopl   0x0(%rax)
L162:
  cmp    $0x8,%rcx
  jne    L568
  mov    0x10(%rsp),%esi
  mov    (%rdi),%ecx
  test   %esi,%esi
  je     L16
  cmp    $0x4,%rdx
  sete   %sil
  test   %r11b,%sil
  je     L354
  cmp    $0x4,%r9
  jne    L354
  cmp    $0x1,%r10
  je     L353
  lea    0x4(%rdi),%rax
  lea    (%rdi,%r10,4),%rdx
  nopl   (%rax)
L226:
  xor    (%rax),%ecx
  add    $0x4,%rax
  mov    %ecx,-0x4(%rax)
  cmp    %rax,%rdx
  jne    L226
  jmp    L353
L483:
  mov    %rdx,%r9
  mov    %rsi,%r10
  mov    %rdi,%rax
  jmp    L275
  xchg   %ax,%ax
L568:
  mov    $0xfffffffffffffffb,%r10
L353:
  mov    %r10,%rax
  ret
  nopl   0x0(%rax,%rax,1)
L404:
  xor    %r10d,%r10d
  mov    %r10,%rax
  ret
  nopw   0x0(%rax,%rax,1)
L527:
  mov    0x10(%rsp),%r8d
  mov    (%rdi),%esi
  test   %r8d,%r8d
  je     L253
  cmp    $0x4,%rdx
  sete   %r8b
  test   %r11b,%r8b
  je     L525
  cmp    $0x4,%r9
  jne    L525
  cmp    $0x1,%r10
  je     L353
  lea    0x4(%rdi),%rax
  lea    (%rdi,%r10,4),%rdx
  nopl   0x0(%rax)
L209:
  xor    (%rax),%esi
  add    $0x4,%rax
  mov    %esi,-0x4(%rax)
  cmp    %rax,%rdx
  jne    L209
  jmp    L353
L435:
  cmp    $0x4,%rdx
  sete   %sil
  test   %r11b,%sil
  je     L383
  cmp    $0x4,%r9
  jne    L383
  cmp    $0x1,%r10
  je     L353
  lea    0x4(%rdi),%rax
  lea    (%rdi,%r10,4),%rdx
  nopl   (%rax)
L235:
  xor    (%rax),%ecx
  add    $0x4,%rax
  mov    %ecx,-0x4(%rax)
  cmp    %rax,%rdx
  jne    L235
  jmp    L353
  nopl   0x0(%rax,%rax,1)
L383:
  mov    %ecx,(%rax)
  cmp    $0x1,%r10
  je     L353
  mov    $0x1,%esi
  nopl   0x0(%rax)
L123:
  add    %rdx,%rdi
  add    %r9,%rax
  add    $0x1,%rsi
  xor    (%rdi),%ecx
  mov    %ecx,(%rax)
  cmp    %r10,%rsi
  jne    L123
  jmp    L353
L525:
  mov    %esi,(%rax)
  cmp    $0x1,%r10
  je     L353
  nopl   0x0(%rax)
L462:
  add    %rdx,%rdi
  add    %r9,%rax
  add    $0x1,%rcx
  xor    (%rdi),%esi
  mov    %esi,(%rax)
  cmp    %r10,%rcx
  jne    L462
  jmp    L353
  nopl   0x0(%rax,%rax,1)
L354:
  mov    %ecx,(%rax)
  cmp    $0x1,%r10
  je     L353
  mov    $0x1,%esi
  nopl   0x0(%rax)
L456:
  add    %rdx,%rdi
  add    %r9,%rax
  add    $0x1,%rsi
  xor    (%rdi),%ecx
  mov    %ecx,(%rax)
  cmp    %r10,%rsi
  jne    L456
  jmp    L353
L496:
  mov    0x10(%rsp),%r8d
  mov    (%rdi),%ecx
  test   %r8d,%r8d
  je     L507
  cmp    $0x4,%rdx
  sete   %sil
  test   %r11b,%sil
  je     L141
  cmp    $0x4,%r9
  jne    L141
  cmp    $0x1,%r10
  je     L353
  lea    0x4(%rdi),%rax
  lea    (%rdi,%r10,4),%rdx
  nopl   0x0(%rax)
L394:
  xor    (%rax),%ecx
  add    $0x4,%rax
  mov    %ecx,-0x4(%rax)
  cmp    %rax,%rdx
  jne    L394
  jmp    L353
  nopl   0x0(%rax,%rax,1)
L141:
  mov    %ecx,(%rax)
  cmp    $0x1,%r10
  je     L353
  mov    $0x1,%esi
  nopl   0x0(%rax)
L258:
  add    %rdx,%rdi
  add    %r9,%rax
  add    $0x1,%rsi
  xor    (%rdi),%ecx
  mov    %ecx,(%rax)
  cmp    %r10,%rsi
  jne    L258
  jmp    L353
L507:
  mov    %ecx,(%rax)
  cmp    $0x1,%r10
  je     L353
  mov    $0x1,%r8d
  nopw   0x0(%rax,%rax,1)
L124:
  add    %rdx,%rdi
  mov    %ecx,%esi
  add    %r9,%rax
  add    $0x1,%r8
  mov    (%rdi),%ecx
  xor    %ecx,%esi
  mov    %esi,(%rax)
  cmp    %r10,%r8
  jne    L124
  jmp    L353
  nopl   0x0(%rax)
L16:
  mov    %ecx,(%rax)
  cmp    $0x1,%r10
  je     L353
  mov    $0x1,%r8d
  nopw   0x0(%rax,%rax,1)
L488:
  add    %rdx,%rdi
  mov    %ecx,%esi
  add    %r9,%rax
  add    $0x1,%r8
  mov    (%rdi),%ecx
  xor    %ecx,%esi
  mov    %esi,(%rax)
  cmp    %r10,%r8
  jne    L488
  jmp    L353
  nopl   0x0(%rax)
L253:
  mov    %esi,(%rax)
  cmp    $0x1,%r10
  je     L353
  nopl   0x0(%rax)
L65:
  add    %rdx,%rdi
  mov    %esi,%r8d
  add    %r9,%rax
  add    $0x1,%rcx
  mov    (%rdi),%esi
  xor    %esi,%r8d
  mov    %r8d,(%rax)
  cmp    %r10,%rcx
  jne    L65
  jmp    L353
```

assistant: ```c
ssize_t imcd_xor(void *src, const ssize_t srcsize, const ssize_t srcstride, void *dst, const ssize_t dstsize, const ssize_t dststride, const ssize_t itemsize, const int decode) {
  const int inplace = (dst == NULL) || (dst == src);
  const ssize_t size = inplace ? srcsize : (((srcsize) < (dstsize)) ? (srcsize) : (dstsize));
  const ssize_t stride = inplace ? srcstride : dststride;
  char *srcptr = (char *)src;
  char *dstptr = inplace ? (char *)src : (char *)dst;
  ssize_t i;
  if ((srcsize < 0) || (dstsize < 0)) {
    return -5;
  }
  if (size <= 0) {
    return 0;
  }
  switch (itemsize) {
  case 1: {
    uint8_t prev, t;
    if (decode) {
      if (inplace && (stride == sizeof(uint8_t)) && (srcstride == sizeof(uint8_t))) {
        uint8_t *psrc = (uint8_t *)srcptr;
        prev = psrc[0];
        for (i = 1; i < size; i++) {
          prev = psrc[i] ^= prev;
        }
      } else {
        *(uint8_t *)dstptr = prev = (*(uint8_t *)srcptr);
        for (i = 1; i < size; i++) {
          dstptr += stride;
          srcptr += srcstride;
          *(uint8_t *)dstptr = prev = (*(uint8_t *)srcptr) ^ prev;
        }
      }
    } else {
      *(uint8_t *)dstptr = prev = (*(uint8_t *)srcptr);
      for (i = 1; i < size; i++) {
        dstptr += stride;
        srcptr += srcstride;
        t = (*(uint8_t *)srcptr);
        *(uint8_t *)dstptr = t ^ prev;
        prev = t;
      }
    }
  }; break;
  case 2: {
    uint16_t prev, t;
    if (decode) {
      if (inplace && (stride == sizeof(uint16_t)) && (srcstride == sizeof(uint16_t))) {
        uint16_t *psrc = (uint16_t *)srcptr;
        prev = psrc[0];
        for (i = 1; i < size; i++) {
          prev = psrc[i] ^= prev;
        }
      } else {
        *(uint16_t *)dstptr = prev = (*(uint16_t *)srcptr);
        for (i = 1; i < size; i++) {
          dstptr += stride;
          srcptr += srcstride;
          *(uint16_t *)dstptr = prev = (*(uint16_t *)srcptr) ^ prev;
        }
      }
    } else {
      *(uint16_t *)dstptr = prev = (*(uint16_t *)srcptr);
      for (i = 1; i < size; i++) {
        dstptr += stride;
        srcptr += srcstride;
        t = (*(uint16_t *)srcptr);
        *(uint16_t *)dstptr = t ^ prev;
        prev = t;
      }
    }
  }; break;
  case 4: {
    uint32_t prev, t;
    if (decode) {
      if (inplace && (stride == sizeof(uint32_t)) && (srcstride == sizeof(uint32_t))) {
        uint32_t *psrc = (uint32_t *)srcptr;
        prev = psrc[0];
        for (i = 1; i < size; i++) {
          prev = psrc[i] ^= prev;
        }
      } else {
        *(uint32_t *)dstptr = prev = (*(uint32_t *)srcptr);
        for (i = 1; i < size; i++) {
          dstptr += stride;
          srcptr += srcstride;
          *(uint32_t *)dstptr = prev = (*(uint32_t *)srcptr) ^ prev;
        }
      }
    } else {
      *(uint32_t *)dstptr = prev = (*(uint32_t *)srcptr);
      for (i = 1; i < size; i++) {
        dstptr += stride;
        srcptr += srcstride;
        t = (*(uint32_t *)srcptr);
        *(uint32_t *)dstptr = t ^ prev;
        prev = t;
      }
    }
  }; break;
  case 8: {
    uint64_t prev, t;
    if (decode) {
      if (inplace && (stride == sizeof(uint64_t)) && (srcstride == sizeof(uint64_t))) {
        uint64_t *psrc = (uint64_t *)srcptr;
        prev = psrc[0];
        for (i = 1; i < size; i++) {
          prev = psrc[i] ^= prev;
        }
      } else {
        *(uint64_t *)dstptr = prev = (*(uint64_t *)srcptr);
        for (i = 1; i < size; i++) {
          dstptr += stride;
          srcptr += srcstride;
          *(uint64_t *)dstptr = prev = (*(uint64_t *)srcptr) ^ prev;
        }
      }
    } else {
      *(uint64_t *)dstptr = prev = (*(uint64_t *)srcptr);
      for (i = 1; i < size; i++) {
        dstptr += stride;
        srcptr += srcstride;
        t = (*(uint64_t *)srcptr);
        *(uint64_t *)dstptr = t ^ prev;
        prev = t;
      }
    }
  }; break;
  default:
    return -5;
  }
  return size;
}
```