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

```asm
<lookup_normal>:
  endbr64
  mov    D7(%rip),%rax
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    (%rax),%ebx
  test   %ecx,%ecx
  jle    L62
  mov    %esi,%eax
  mov    %esi,%r11d
  mov    %ecx,%ebp
  mov    %rdx,%r8
  shr    $0x4,%eax
  lea    -0x1(%rsi),%r12d
  and    $0xfffffff0,%r11d
  xor    %ecx,%ecx
  lea    -0x1(%rax),%r9d
  xor    %r10d,%r10d
  mov    $0xffffffff,%r13d
  add    $0x1,%r9
  pxor   %xmm4,%xmm4
  shl    $0x4,%r9
  nop
L139:
  xor    %eax,%eax
  test   %esi,%esi
  jle    L66
  cmp    $0xe,%r12d
  jbe    L88
  movslq %ecx,%rdx
  xor    %eax,%eax
  pxor   %xmm2,%xmm2
  add    %r8,%rdx
L148:
  movdqu (%rdi,%rax,1),%xmm0
  movdqu (%rdx,%rax,1),%xmm3
  add    $0x10,%rax
  movdqa %xmm0,%xmm1
  movdqa %xmm3,%xmm5
  punpckhbw %xmm4,%xmm0
  punpcklbw %xmm4,%xmm1
  punpcklbw %xmm4,%xmm5
  punpckhbw %xmm4,%xmm3
  psubw  %xmm5,%xmm1
  psubw  %xmm3,%xmm0
  pmaddwd %xmm1,%xmm1
  pmaddwd %xmm0,%xmm0
  paddd  %xmm1,%xmm2
  paddd  %xmm0,%xmm2
  cmp    %r9,%rax
  jne    L148
  movdqa %xmm2,%xmm0
  psrldq $0x8,%xmm0
  paddd  %xmm0,%xmm2
  movdqa %xmm2,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm2
  movd   %xmm2,%eax
  cmp    %esi,%r11d
  je     L66
  mov    %r11d,%edx
L61:
  lea    (%rcx,%rdx,1),%r15d
  movslq %edx,%r14
  movslq %r15d,%r15
  movzbl (%rdi,%r14,1),%r14d
  movzbl (%r8,%r15,1),%r15d
  sub    %r15d,%r14d
  imul   %r14d,%r14d
  add    %r14d,%eax
  lea    0x1(%rdx),%r14d
  cmp    %r14d,%esi
  jle    L66
  movslq %r14d,%r15
  add    %ecx,%r14d
  movslq %r14d,%r14
  movzbl (%rdi,%r15,1),%r15d
  movzbl (%r8,%r14,1),%r14d
  sub    %r14d,%r15d
  lea    0x2(%rdx),%r14d
  imul   %r15d,%r15d
  add    %r15d,%eax
  cmp    %r14d,%esi
  jle    L66
  movslq %r14d,%r15
  add    %ecx,%r14d
  movslq %r14d,%r14
  movzbl (%rdi,%r15,1),%r15d
  movzbl (%r8,%r14,1),%r14d
  sub    %r14d,%r15d
  lea    0x3(%rdx),%r14d
  imul   %r15d,%r15d
  add    %r15d,%eax
  cmp    %r14d,%esi
  jle    L66
  movslq %r14d,%r15
  add    %ecx,%r14d
  movslq %r14d,%r14
  movzbl (%rdi,%r15,1),%r15d
  movzbl (%r8,%r14,1),%r14d
  sub    %r14d,%r15d
  lea    0x4(%rdx),%r14d
  imul   %r15d,%r15d
  add    %r15d,%eax
  cmp    %r14d,%esi
  jle    L66
  movslq %r14d,%r15
  add    %ecx,%r14d
  movslq %r14d,%r14
  movzbl (%rdi,%r15,1),%r15d
  movzbl (%r8,%r14,1),%r14d
  sub    %r14d,%r15d
  lea    0x5(%rdx),%r14d
  imul   %r15d,%r15d
  add    %r15d,%eax
  cmp    %r14d,%esi
  jle    L66
  movslq %r14d,%r15
  add    %ecx,%r14d
  movslq %r14d,%r14
  movzbl (%rdi,%r15,1),%r15d
  movzbl (%r8,%r14,1),%r14d
  sub    %r14d,%r15d
  lea    0x6(%rdx),%r14d
  imul   %r15d,%r15d
  add    %r15d,%eax
  cmp    %r14d,%esi
  jle    L66
  movslq %r14d,%r15
  add    %ecx,%r14d
  movslq %r14d,%r14
  movzbl (%rdi,%r15,1),%r15d
  movzbl (%r8,%r14,1),%r14d
  sub    %r14d,%r15d
  lea    0x7(%rdx),%r14d
  imul   %r15d,%r15d
  add    %r15d,%eax
  cmp    %r14d,%esi
  jle    L66
  movslq %r14d,%r15
  add    %ecx,%r14d
  movslq %r14d,%r14
  movzbl (%rdi,%r15,1),%r15d
  movzbl (%r8,%r14,1),%r14d
  sub    %r14d,%r15d
  lea    0x8(%rdx),%r14d
  imul   %r15d,%r15d
  add    %r15d,%eax
  cmp    %r14d,%esi
  jle    L66
  movslq %r14d,%r15
  add    %ecx,%r14d
  movslq %r14d,%r14
  movzbl (%rdi,%r15,1),%r15d
  movzbl (%r8,%r14,1),%r14d
  sub    %r14d,%r15d
  lea    0x9(%rdx),%r14d
  imul   %r15d,%r15d
  add    %r15d,%eax
  cmp    %r14d,%esi
  jle    L66
  movslq %r14d,%r15
  add    %ecx,%r14d
  movslq %r14d,%r14
  movzbl (%rdi,%r15,1),%r15d
  movzbl (%r8,%r14,1),%r14d
  sub    %r14d,%r15d
  lea    0xa(%rdx),%r14d
  imul   %r15d,%r15d
  add    %r15d,%eax
  cmp    %r14d,%esi
  jle    L66
  movslq %r14d,%r15
  add    %ecx,%r14d
  movslq %r14d,%r14
  movzbl (%rdi,%r15,1),%r15d
  movzbl (%r8,%r14,1),%r14d
  sub    %r14d,%r15d
  lea    0xb(%rdx),%r14d
  imul   %r15d,%r15d
  add    %r15d,%eax
  cmp    %r14d,%esi
  jle    L66
  movslq %r14d,%r15
  add    %ecx,%r14d
  movslq %r14d,%r14
  movzbl (%rdi,%r15,1),%r15d
  movzbl (%r8,%r14,1),%r14d
  sub    %r14d,%r15d
  lea    0xc(%rdx),%r14d
  imul   %r15d,%r15d
  add    %r15d,%eax
  cmp    %r14d,%esi
  jle    L66
  movslq %r14d,%r15
  add    %ecx,%r14d
  movslq %r14d,%r14
  movzbl (%rdi,%r15,1),%r15d
  movzbl (%r8,%r14,1),%r14d
  sub    %r14d,%r15d
  lea    0xd(%rdx),%r14d
  imul   %r15d,%r15d
  add    %r15d,%eax
  cmp    %r14d,%esi
  jle    L66
  movslq %r14d,%r15
  add    %ecx,%r14d
  add    $0xe,%edx
  movslq %r14d,%r14
  movzbl (%rdi,%r15,1),%r15d
  movzbl (%r8,%r14,1),%r14d
  sub    %r14d,%r15d
  imul   %r15d,%r15d
  add    %r15d,%eax
  cmp    %edx,%esi
  jle    L66
  movslq %edx,%r14
  add    %ecx,%edx
  movslq %edx,%rdx
  movzbl (%rdi,%r14,1),%r14d
  movzbl (%r8,%rdx,1),%edx
  sub    %edx,%r14d
  imul   %r14d,%r14d
  add    %r14d,%eax
  nopl   0x0(%rax,%rax,1)
L66:
  cmp    %eax,%ebx
  jle    L151
  mov    %eax,%ebx
  mov    %r10d,%r13d
L151:
  add    $0x1,%r10d
  add    %esi,%ecx
  cmp    %r10d,%ebp
  jne    L139
  pop    %rbx
  mov    %r13d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L88:
  xor    %eax,%eax
  xor    %edx,%edx
  jmp    L61
L62:
  mov    $0xffffffff,%r13d
  pop    %rbx
  pop    %rbp
  mov    %r13d,%eax
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int lookup_normal(unsigned char const *const pixel, int const depth, unsigned char const *const palette, int const ncolor, unsigned short *const cachetable) {
  int index;
  int diff;
  int r;
  int i;
  int n;
  int distant;
  index = -1;
  diff = INT_MAX;
  for (i = 0; i < ncolor; i++) {
    distant = 0;
    for (n = 0; n < depth; ++n) {
      r = pixel[n] - palette[i * depth + n];
      distant += r * r;
    }
    if (distant < diff) {
      diff = distant;
      index = i;
    }
  }
  return index;
}
```