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

```asm
<hist_omp>:
  endbr64
  push   %r13
  imul   %edx,%esi
  xor    %r13d,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    $0x400,%edi
  mov    %esi,%r12d
  sub    $0x8,%rsp
  call   <xmalloc@plt>
  lea    0x8(%rax),%rdi
  mov    %rax,%rcx
  movq   $0x0,(%rax)
  mov    %rax,%rbp
  movq   $0x0,0x3f8(%rax)
  and    $0xfffffffffffffff8,%rdi
  mov    %r13,%rax
  sub    %rdi,%rcx
  add    $0x400,%ecx
  shr    $0x3,%ecx
  rep stos %rax,%es:(%rdi)
  mov    $0x400,%edi
  call   <xmalloc@plt>
  lea    0x8(%rax),%rdi
  mov    %rax,%rcx
  movq   $0x0,(%rax)
  mov    %rax,%r8
  movq   $0x0,0x3f8(%rax)
  and    $0xfffffffffffffff8,%rdi
  mov    %r13,%rax
  sub    %rdi,%rcx
  add    $0x400,%ecx
  shr    $0x3,%ecx
  rep stos %rax,%es:(%rdi)
  test   %r12d,%r12d
  jle    L20
  lea    -0x1(%r12),%edx
  mov    %rbx,%rax
  lea    0x8(%rbx,%rdx,8),%rcx
  nopl   0x0(%rax)
L96:
  mov    (%rax),%rdx
  add    $0x8,%rax
  addl   $0x1,(%r8,%rdx,4)
  cmp    %rax,%rcx
  jne    L96
L20:
  lea    0x4(%r8),%rax
  mov    %rbp,%rdx
  sub    %rax,%rdx
  xor    %eax,%eax
  cmp    $0x8,%rdx
  jbe    L21
  nop
L16:
  movdqu (%r8,%rax,1),%xmm0
  movdqu 0x0(%rbp,%rax,1),%xmm1
  paddd  %xmm1,%xmm0
  movups %xmm0,0x0(%rbp,%rax,1)
  add    $0x10,%rax
  cmp    $0x400,%rax
  jne    L16
L11:
  mov    %r8,%rdi
  call   <free@plt>
  xor    %eax,%eax
  jmp    L61
  nopl   (%rax)
L51:
  add    $0x1,%rax
  cmp    $0x100,%rax
  je     L138
L61:
  mov    0x0(%rbp,%rax,4),%edi
  movslq %eax,%rcx
  test   %edi,%edi
  je     L51
L104:
  mov    $0xff,%eax
  jmp    L99
  nopw   0x0(%rax,%rax,1)
L90:
  sub    $0x1,%rax
  jb     L119
L99:
  mov    0x0(%rbp,%rax,4),%esi
  mov    %eax,%edx
  test   %esi,%esi
  je     L90
L110:
  mov    %edx,%esi
  mov    $0xff,%eax
  sub    %ecx,%esi
  cltd
  idiv   %esi
  test   %r12d,%r12d
  jle    L144
  movslq %eax,%rdx
  lea    -0x1(%r12),%eax
  lea    0x8(%rbx,%rax,8),%rsi
  nopw   0x0(%rax,%rax,1)
L47:
  mov    (%rbx),%rax
  add    $0x8,%rbx
  sub    %rcx,%rax
  imul   %rdx,%rax
  mov    %rax,-0x8(%rbx)
  cmp    %rbx,%rsi
  jne    L47
L144:
  add    $0x8,%rsp
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1060 <free@plt>
  nopl   0x0(%rax)
L21:
  mov    (%r8,%rax,1),%edx
  add    %edx,0x0(%rbp,%rax,1)
  add    $0x4,%rax
  cmp    $0x400,%rax
  jne    L21
  jmp    L11
L138:
  mov    $0x100,%ecx
  jmp    L104
L119:
  mov    $0xffffffff,%edx
  jmp    L110
```

assistant: ```c
void hist_omp(uint8_t *pixels, int height, int width) {
  uint64_t npixels = height * width;
  int *h = xmalloc(sizeof(*h) * 256);
  for (int i = 0; i < 256; i++)
    h[i] = 0;
#pragma omp parallel
  {
    int *hloc = xmalloc(sizeof(*hloc) * 256);
    for (int i = 0; i < 256; i++)
      hloc[i] = 0;
#pragma omp for nowait
    for (int i = 0; i < npixels; i++)
      hloc[pixels[i]]++;
#pragma omp critical
    {
      for (int i = 0; i < 256; i++)
        h[i] += hloc[i];
    }
    free(hloc);
#pragma omp barrier
    int mini, maxi;
    for (mini = 0; mini < 256 && h[mini] == 0; mini++)
      ;
    for (maxi = 255; maxi >= 0 && h[maxi] == 0; maxi--)
      ;
    int q = 255 / (maxi - mini);
#pragma omp for
    for (int i = 0; i < npixels; i++)
      pixels[i] = (pixels[i] - mini) * q;
  }
  free(h);
}
```