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

```asm
<hist_omp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  mov    %edx,-0x50(%rbp)
  mov    -0x4c(%rbp),%eax
  imul   -0x50(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  mov    $0x400,%edi
  call   <xmalloc@plt>
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L79
L41:
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  addl   $0x1,-0x34(%rbp)
L79:
  cmpl   $0xff,-0x34(%rbp)
  jle    L41
  mov    $0x400,%edi
  call   <xmalloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x30(%rbp)
  jmp    L38
L73:
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  addl   $0x1,-0x30(%rbp)
L38:
  cmpl   $0xff,-0x30(%rbp)
  jle    L73
  movl   $0x0,-0x2c(%rbp)
  jmp    L30
L157:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  add    $0x1,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x2c(%rbp)
L30:
  mov    -0x2c(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L157
  movl   $0x0,-0x28(%rbp)
  jmp    L109
L37:
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x10(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x28(%rbp)
L109:
  cmpl   $0xff,-0x28(%rbp)
  jle    L37
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movl   $0x0,-0x24(%rbp)
  jmp    L128
L156:
  addl   $0x1,-0x24(%rbp)
L128:
  cmpl   $0xff,-0x24(%rbp)
  jg     L107
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L156
L107:
  movl   $0xff,-0x20(%rbp)
  jmp    L154
L121:
  subl   $0x1,-0x20(%rbp)
L154:
  cmpl   $0x0,-0x20(%rbp)
  js     L155
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L121
L155:
  mov    -0x20(%rbp),%eax
  sub    -0x24(%rbp),%eax
  mov    %eax,%ecx
  mov    $0xff,%eax
  cltd
  idiv   %ecx
  mov    %eax,-0x14(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L105
L103:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x24(%rbp),%edx
  movslq %edx,%rdx
  sub    %rdx,%rax
  mov    %rax,%rcx
  mov    -0x14(%rbp),%eax
  cltq
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rsi
  mov    -0x48(%rbp),%rdx
  add    %rsi,%rdx
  imul   %rcx,%rax
  mov    %rax,(%rdx)
  addl   $0x1,-0x1c(%rbp)
L105:
  mov    -0x1c(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L103
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

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);
}
```