user: Converte this assembly snippet into its equivalent C code:

```asm
<sjis_cpy>:
  endbr64
  mov    %ecx,%r9d
  mov    %rdx,%r8
  mov    (%rsi),%rcx
  test   %r9d,%r9d
  je     L14
  mov    %rsi,%r11
  test   %ecx,%ecx
  je     L106
  push   %rbp
  xor    %eax,%eax
  push   %rbx
  mov    %ecx,%ebx
  xor    %ecx,%ecx
  jmp    L276
  nopl   0x0(%rax,%rax,1)
L175:
  movzbl %dl,%esi
  mov    %r9d,%eax
L141:
  mov    %esi,(%r10)
  add    $0x1,%ecx
  cmp    %ebx,%eax
  jae    L15
L276:
  mov    %eax,%edx
  mov    %ecx,%esi
  lea    0x1(%rax),%r9d
  movzbl (%rdi,%rdx,1),%edx
  lea    (%r8,%rsi,4),%r10
  lea    0x7f(%rdx),%esi
  cmp    $0x1e,%sil
  jbe    L146
  lea    0x20(%rdx),%esi
  cmp    $0xb,%sil
  ja     L175
L146:
  mov    %ebx,%esi
  sub    %eax,%esi
  cmp    $0x1,%esi
  je     L175
  mov    %r9d,%esi
  mov    %edx,%ebp
  movzbl (%rdi,%rsi,1),%esi
  shl    $0x8,%ebp
  or     %ebp,%esi
  lea    -0x8140(%rsi),%ebp
  cmp    $0x1ebc,%ebp
  jbe    L38
  lea    -0xe040(%rsi),%ebp
  cmp    $0xb7f,%ebp
  jbe    L38
  mov    %edx,%esi
  mov    %r9d,%eax
  add    $0x1,%ecx
  mov    %esi,(%r10)
  cmp    %ebx,%eax
  jb     L276
L15:
  mov    %rcx,(%r11)
  pop    %rbx
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L14:
  test   %ecx,%ecx
  je     L291
  mov    %ecx,%edx
  lea    (%r8,%rdx,4),%rax
  lea    (%rdi,%rdx,1),%rsi
  cmp    %rax,%rdi
  setae  %al
  cmp    %rsi,%r8
  setae  %sil
  or     %sil,%al
  je     L30
  lea    -0x1(%rcx),%eax
  cmp    $0xe,%eax
  jbe    L30
  mov    %ecx,%esi
  mov    %rdi,%rdx
  pxor   %xmm3,%xmm3
  mov    %r8,%rax
  shr    $0x4,%esi
  pxor   %xmm2,%xmm2
  sub    $0x1,%esi
  shl    $0x4,%rsi
  lea    0x10(%rdi,%rsi,1),%rsi
  nopl   0x0(%rax,%rax,1)
L307:
  movdqu (%rdx),%xmm0
  add    $0x10,%rdx
  add    $0x40,%rax
  movdqa %xmm0,%xmm1
  punpckhbw %xmm3,%xmm0
  punpcklbw %xmm3,%xmm1
  movdqa %xmm1,%xmm4
  punpckhwd %xmm2,%xmm1
  movups %xmm1,-0x30(%rax)
  movdqa %xmm0,%xmm1
  punpcklwd %xmm2,%xmm4
  punpckhwd %xmm2,%xmm0
  punpcklwd %xmm2,%xmm1
  movups %xmm4,-0x40(%rax)
  movups %xmm1,-0x20(%rax)
  movups %xmm0,-0x10(%rax)
  cmp    %rsi,%rdx
  jne    L307
  mov    %ecx,%eax
  and    $0xfffffff0,%eax
  test   $0xf,%cl
  je     L291
  mov    %eax,%edx
  movzbl (%rdi,%rdx,1),%esi
  mov    %esi,(%r8,%rdx,4)
  lea    0x1(%rax),%edx
  cmp    %ecx,%edx
  jae    L291
  movzbl (%rdi,%rdx,1),%esi
  mov    %esi,(%r8,%rdx,4)
  lea    0x2(%rax),%edx
  cmp    %edx,%ecx
  jbe    L291
  movzbl (%rdi,%rdx,1),%esi
  mov    %esi,(%r8,%rdx,4)
  lea    0x3(%rax),%edx
  cmp    %edx,%ecx
  jbe    L291
  movzbl (%rdi,%rdx,1),%esi
  mov    %esi,(%r8,%rdx,4)
  lea    0x4(%rax),%edx
  cmp    %edx,%ecx
  jbe    L291
  movzbl (%rdi,%rdx,1),%esi
  mov    %esi,(%r8,%rdx,4)
  lea    0x5(%rax),%edx
  cmp    %edx,%ecx
  jbe    L291
  movzbl (%rdi,%rdx,1),%esi
  mov    %esi,(%r8,%rdx,4)
  lea    0x6(%rax),%edx
  cmp    %edx,%ecx
  jbe    L291
  movzbl (%rdi,%rdx,1),%esi
  mov    %esi,(%r8,%rdx,4)
  lea    0x7(%rax),%edx
  cmp    %edx,%ecx
  jbe    L291
  movzbl (%rdi,%rdx,1),%esi
  mov    %esi,(%r8,%rdx,4)
  lea    0x8(%rax),%edx
  cmp    %edx,%ecx
  jbe    L291
  movzbl (%rdi,%rdx,1),%esi
  mov    %esi,(%r8,%rdx,4)
  lea    0x9(%rax),%edx
  cmp    %edx,%ecx
  jbe    L291
  movzbl (%rdi,%rdx,1),%esi
  mov    %esi,(%r8,%rdx,4)
  lea    0xa(%rax),%edx
  cmp    %edx,%ecx
  jbe    L291
  movzbl (%rdi,%rdx,1),%esi
  mov    %esi,(%r8,%rdx,4)
  lea    0xb(%rax),%edx
  cmp    %edx,%ecx
  jbe    L291
  movzbl (%rdi,%rdx,1),%esi
  mov    %esi,(%r8,%rdx,4)
  lea    0xc(%rax),%edx
  cmp    %edx,%ecx
  jbe    L291
  movzbl (%rdi,%rdx,1),%esi
  mov    %esi,(%r8,%rdx,4)
  lea    0xd(%rax),%edx
  cmp    %edx,%ecx
  jbe    L291
  movzbl (%rdi,%rdx,1),%esi
  add    $0xe,%eax
  mov    %esi,(%r8,%rdx,4)
  cmp    %eax,%ecx
  jbe    L291
  movzbl (%rdi,%rax,1),%edx
  mov    %edx,(%r8,%rax,4)
  ret
  nopl   0x0(%rax)
L38:
  add    $0x2,%eax
  jmp    L141
  nopl   0x0(%rax,%rax,1)
L106:
  xor    %ecx,%ecx
  mov    %rcx,(%rsi)
L291:
  ret
  cs nopw 0x0(%rax,%rax,1)
L30:
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L36:
  movzbl (%rdi,%rax,1),%ecx
  mov    %ecx,(%r8,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L36
  ret
```

assistant: ```c
__attribute__((visibility("hidden"))) void sjis_cpy(const unsigned char source[], size_t *p_length, unsigned int *jisdata, int full_multibyte) {
  unsigned int i, j, jis, length;
  unsigned char c;
  if (full_multibyte) {
    for (i = 0, j = 0, length = *p_length; i < length; i++, j++) {
      c = source[i];
      if (((c >= 0x81 && c <= 0x9F) || (c >= 0xE0 && c <= 0xEB)) && length - i >= 2) {
        jis = (c << 8) | source[i + 1];
        if ((jis >= 0x8140 && jis <= 0x9FFC) || (jis >= 0xE040 && jis <= 0xEBBF)) {
          jisdata[j] = jis;
          i++;
        } else {
          jisdata[j] = c;
        }
      } else {
        jisdata[j] = c;
      }
    }
    *p_length = j;
  } else {
    for (i = 0, length = *p_length; i < length; i++) {
      jisdata[i] = source[i];
    }
  }
}
```