user: 下面的汇编指令对应的C源代码是什么：

```asm
<draw_hist>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  movl   $0x100,-0x18(%rbp)
  movl   $0x100,-0x14(%rbp)
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%eax
  imul   -0x14(%rbp),%eax
  cltq
  add    %rax,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x28(%rbp)
  jmp    L112
L53:
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L0
L17:
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x24(%rbp),%eax
  cltq
  add    %rdx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    %eax,-0x20(%rbp)
  addl   $0x1,-0x24(%rbp)
L0:
  mov    $0x1000,%eax
  cltd
  idivl  -0x18(%rbp)
  cmp    %eax,-0x24(%rbp)
  jl     L17
  mov    -0x28(%rbp),%eax
  imul   -0x18(%rbp),%eax
  lea    0xfff(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0xc,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  mov    -0x20(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x20(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jle    L45
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
L45:
  mov    $0x1000,%eax
  cltd
  idivl  -0x18(%rbp)
  add    %eax,-0x28(%rbp)
L112:
  cmpl   $0xfff,-0x28(%rbp)
  jle    L53
  cmpl   $0x0,-0x3c(%rbp)
  je     L21
  mov    -0x3c(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
L21:
  movl   $0x0,-0x28(%rbp)
  jmp    L81
L54:
  movl   $0x0,-0x24(%rbp)
  jmp    L61
L47:
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x14(%rbp),%edx
  sub    $0x1,%edx
  imul   %edx,%eax
  cltd
  idivl  -0x1c(%rbp)
  cmp    %eax,-0x24(%rbp)
  jg     L90
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%eax
  imul   -0x24(%rbp),%eax
  cltq
  add    %rdx,%rax
  lea    (%rax,%rax,1),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movw   $0xfff,(%rax)
  jmp    L76
L90:
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%eax
  imul   -0x24(%rbp),%eax
  cltq
  add    %rdx,%rax
  lea    (%rax,%rax,1),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movw   $0x0,(%rax)
L76:
  addl   $0x1,-0x24(%rbp)
L61:
  mov    -0x24(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L47
  addl   $0x1,-0x28(%rbp)
L81:
  mov    -0x28(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L54
  mov    -0x18(%rbp),%eax
  imul   -0x14(%rbp),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x8(%rbp),%rax
  lea    D1(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <put_image@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D1
type_infered: string

tool: D1: hist.img

assistant: ```c
void draw_hist(int *bin, int max) {
  int i, j, sum, amax, ncol = 256, nrow = 256, *sbin;
  short int *hist;
  sbin = (int *)malloc(ncol * sizeof(int));
  hist = (short int *)malloc(ncol * nrow * sizeof(short int));
  amax = 0;
  for (i = 0; i < 4096; i += (4096 / ncol)) {
    sum = 0;
    for (j = 0; j < (4096 / ncol); ++j)
      sum += *(bin + i + j);
    *(sbin + i * ncol / 4096) = sum;
    if (sum > amax)
      amax = sum;
  }
  if (max != 0)
    amax = max;
  for (i = 0; i < ncol; ++i) {
    for (j = 0; j < nrow; ++j) {
      if (j <= (*(sbin + i) * (nrow - 1) / amax))
        *(hist + i + ncol * j) = 4096 - 1;
      else
        *(hist + i + ncol * j) = 0;
    }
  }
  put_image((unsigned char *)hist, "hist.img", 2 * ncol * nrow);
  free(hist);
  free(sbin);
}
```