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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    D2(%rip),%rdi
  call   <printf@plt>
  lea    -0x40(%rbp),%rsi
  lea    D9(%rip),%rdi
  call   <scanf@plt>
  movslq -0x40(%rbp),%rax
  shl    $0x2,%rax
  lea    0xf(%rax),%rdx
  mov    %rdx,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rcx
  sub    %rdx,%rcx
L21:
  cmp    %rcx,%rsp
  je     L5
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L21
L5:
  mov    %rsi,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L247
  orq    $0x0,-0x8(%rsp,%rdx,1)
L247:
  mov    %rsp,%r14
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffffff0,%rdx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rcx
  sub    %rax,%rcx
L109:
  cmp    %rcx,%rsp
  je     L269
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L109
L269:
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L166
  orq    $0x0,-0x8(%rsp,%rax,1)
L166:
  mov    %rsp,%rbx
  lea    D17(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x3c(%rbp),%rsi
  lea    D9(%rip),%rdi
  call   <scanf@plt>
  lea    D76(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x0,-0x3c(%rbp)
  jle    L186
  mov    %r14,%r13
  mov    $0x0,%r12d
  lea    D9(%rip),%r15
L10:
  mov    %r13,%rsi
  mov    %r15,%rdi
  call   <scanf@plt>
  add    $0x1,%r12d
  mov    -0x3c(%rbp),%edi
  add    $0x4,%r13
  cmp    %r12d,%edi
  jg     L10
  test   %edi,%edi
  jle    L186
  lea    -0x2(%rdi),%r8d
  mov    %r8d,%eax
  lea    0x4(%r14,%rax,4),%rsi
  mov    $0x0,%r9d
  jmp    L127
L92:
  add    $0x4,%rax
  cmp    %rsi,%rax
  je     L229
L94:
  mov    (%rax),%edx
  mov    0x4(%rax),%ecx
  cmp    %ecx,%edx
  jle    L92
  mov    %ecx,(%rax)
  mov    %edx,0x4(%rax)
  jmp    L92
L229:
  add    $0x1,%r9d
  cmp    %r9d,%edi
  je     L28
L127:
  mov    %r14,%rax
  cmp    $0x1,%edi
  jg     L94
  jmp    L229
L28:
  lea    -0x1(%rdi),%r9d
  mov    %r14,%rdi
  mov    $0x0,%edx
  lea    0x4(%r14),%r10
  jmp    L206
L114:
  add    $0x4,%rax
  cmp    %rcx,%rax
  je     L27
L228:
  cmp    0x4(%rax),%esi
  jne    L114
  addl   $0x1,(%rbx,%rdx,4)
  jmp    L114
L27:
  add    $0x1,%rdx
  add    $0x4,%rdi
L206:
  movl   $0x0,(%rbx,%rdx,4)
  cmp    %rdx,%r9
  je     L186
  mov    (%rdi),%esi
  mov    %r8d,%eax
  sub    %edx,%eax
  add    %rdx,%rax
  lea    (%r10,%rax,4),%rcx
  mov    %rdi,%rax
  jmp    L228
L186:
  lea    D69(%rip),%rdi
  call   <puts@plt>
  cmpl   $0x0,-0x40(%rbp)
  js     L143
  movl   $0x0,-0x44(%rbp)
  mov    $0x0,%r12d
  jmp    L267
L235:
  mov    %r12d,%esi
  lea    D84(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movslq -0x44(%rbp),%rax
  mov    (%rbx,%rax,4),%r15d
  test   %r15d,%r15d
  js     L20
  mov    $0x0,%r13d
L212:
  mov    $0x2a,%edi
  call   <putchar@plt>
  add    $0x1,%r13d
  cmp    %r15d,%r13d
  jle    L212
L20:
  mov    -0x44(%rbp),%eax
  lea    0x1(%rax,%r15,1),%eax
  mov    %eax,-0x44(%rbp)
  mov    $0xa,%edi
  call   <putchar@plt>
L18:
  add    $0x1,%r12d
  cmp    %r12d,-0x40(%rbp)
  jl     L143
L267:
  movslq -0x44(%rbp),%rax
  cmp    %r12d,(%r14,%rax,4)
  je     L235
  mov    %r12d,%esi
  lea    D79(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L18
L143:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L131
  mov    $0x0,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L131:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D2
datatype: string
name: disassemble_data
arguments: data_label: D9
datatype: string
name: disassemble_data
arguments: data_label: D17
datatype: string
name: disassemble_data
arguments: data_label: D76
datatype: string
name: disassemble_data
arguments: data_label: D69
datatype: string
name: disassemble_data
arguments: data_label: D84
datatype: string
name: disassemble_data
arguments: data_label: D79
datatype: string

tool: D2: Enter range: 

tool: D9: %d

tool: D17: Enter length: 

tool: D76: Enter array: 

tool: D69: Histogram:

tool: D84: %d: 

tool: D79: %d: 


assistant: ```c
int main() {
  int range, length, br, c, j;
  printf("Enter range: ");
  scanf("%d", &range);
  int array[range], HowMuch[range];
  printf("Enter length: ");
  scanf("%d", &length);
  printf("Enter array: ");
  for (br = 0; br < length; br++) {
    scanf("%d", &array[br]);
  }
  for (br = 0; br < length; br++) {
    for (j = 0; j < length - 1; j++) {
      if (array[j] > array[j + 1]) {
        c = array[j];
        array[j] = array[j + 1];
        array[j + 1] = c;
      }
    }
  }
  for (br = 0; br < length; br++) {
    HowMuch[br] = 0;
    for (j = br + 1; j < length; j++) {
      if (array[br] == array[j]) {
        HowMuch[br] = HowMuch[br] + 1;
      }
    }
  }
  j = 0;
  printf("Histogram:\n");
  for (br = 0; br <= range; br++)
    if (br == array[j]) {
      printf("%d: ", br);
      for (c = 0; c <= HowMuch[j]; c++) {
        printf("*");
      }
      j = j + 1 + HowMuch[j];
      printf("\n");
    } else {
      printf("%d: \n", br);
    }
  return 0;
}
```