user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %r15
  movabs $0x2020202020202020,%r15
  push   %r14
  movabs $0x2020202020202020,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xd8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  lea    0x30(%rsp),%rax
  movq   $0xfffffffffffffff3,0x28(%rsp)
  mov    %rax,0x10(%rsp)
  lea    0x24(%rsp),%rax
  mov    %rax,0x18(%rsp)
L88:
  mov    0x10(%rsp),%rdi
  mov    $0xa,%ecx
  xor    %eax,%eax
  mov    0x18(%rsp),%rbx
  rep stos %rax,%es:(%rdi)
  movl   $0x0,(%rdi)
  nopl   0x0(%rax,%rax,1)
L70:
  mov    $0x14,%esi
  lea    D64(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D5(%rip),%rdi
  mov    %rbx,%rsi
  call   <scanf@plt>
  mov    0x24(%rsp),%edi
  cmp    $0x14,%edi
  jg     L70
  test   %edi,%edi
  js     L22
  mov    $0x2710,%ebx
  lea    0x28(%rsp),%rbp
  nopl   (%rax)
L30:
  mov    %rbp,%rsi
  call   <gamdev@plt>
  cmp    $0x14,%eax
  ja     L92
  cltq
  addl   $0x1,0x30(%rsp,%rax,4)
L92:
  mov    0x24(%rsp),%edi
  sub    $0x1,%ebx
  jne    L30
  mov    %edi,%esi
  mov    $0x2710,%edx
  lea    D80(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D92(%rip),%rcx
  xor    %eax,%eax
  lea    D69(%rip),%rdx
  lea    D17(%rip),%rsi
  lea    D48(%rip),%rdi
  call   <printf@plt>
  movq   $0x0,(%rsp)
  lea    0x91(%rsp),%r13
  nopl   (%rax)
L35:
  mov    (%rsp),%rax
  mov    0x10(%rsp),%rcx
  pxor   %xmm0,%xmm0
  mov    $0x32,%ebx
  movss  D58(%rip),%xmm1
  mov    %r14,0x0(%r13)
  cvtsi2ssl (%rcx,%rax,4),%xmm0
  divss  D49(%rip),%xmm0
  mov    %eax,%ebp
  mov    %r15,0x8(%r13)
  mulss  %xmm0,%xmm1
  mov    $0x2020,%eax
  mov    %r14,0x10(%r13)
  cvtss2sd %xmm0,%xmm0
  mov    %ax,0x30(%r13)
  mov    %r15,0x18(%r13)
  mov    %r14,0x20(%r13)
  mov    %r15,0x28(%r13)
  cvttss2si %xmm1,%eax
  cmp    %ebx,%eax
  cmovle %eax,%ebx
  test   %eax,%eax
  jle    L37
  lea    -0x1(%rbx),%edx
  mov    $0x2a,%esi
  mov    %r13,%rdi
  movsd  %xmm0,0x8(%rsp)
  add    $0x1,%rdx
  mov    $0x1,%r12d
  call   <memset@plt>
  movsd  0x8(%rsp),%xmm0
  mov    %ebp,%esi
  lea    D106(%rip),%rdi
  mov    $0x1,%eax
  lea    0x90(%rsp),%rbp
  call   <printf@plt>
  nopl   0x0(%rax)
L18:
  movsbl 0x0(%rbp,%r12,1),%edi
  add    $0x1,%r12
  call   <putchar@plt>
  cmp    %r12d,%ebx
  jge    L18
L38:
  mov    $0xa,%edi
  call   <putchar@plt>
  addq   $0x1,(%rsp)
  mov    (%rsp),%rax
  cmp    $0x14,%rax
  jne    L35
  jmp    L88
L37:
  mov    %ebp,%esi
  lea    D106(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  jmp    L38
L22:
  mov    0xc8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L96
  add    $0xd8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L96:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D64
datatype: string
name: unpack_data
arguments: data_label: D5
datatype: string
name: unpack_data
arguments: data_label: D80
datatype: string
name: unpack_data
arguments: data_label: D92
datatype: string
name: unpack_data
arguments: data_label: D69
datatype: string
name: unpack_data
arguments: data_label: D17
datatype: string
name: unpack_data
arguments: data_label: D48
datatype: string
name: unpack_data
arguments: data_label: D58
datatype: byte[4]
name: unpack_data
arguments: data_label: D49
datatype: byte[4]
name: unpack_data
arguments: data_label: D106
datatype: string

tool: D64: Select order of Gamma distribution (n=1..%d), -1 to end


tool: D5: %d

tool: D80: 
gamma-distribution deviate, order %2d of %6d points


tool: D92: graph:

tool: D69: p(x)

tool: D17: x

tool: D48: %6s %7s %9s 


tool: {"D58": [0x00,0x00,0x48,0x43]}

tool: {"D49": [0x00,0x40,0x1c,0x46]}

tool: D106: %6d %8.4f  

assistant: ```c
int main(void) {
  char words[50 + 1];
  long idum = (-13);
  int i, ia, j, k, klim, dist[20 + 1];
  float dd;
  for (;;) {
    for (j = 0; j <= 20; j++)
      dist[j] = 0;
    do {
      printf("Select order of Gamma distribution (n=1..%d), -1 to end\n", 20);
      scanf("%d", &ia);
    } while (ia > 20);
    if (ia < 0)
      break;
    for (i = 1; i <= 10000; i++) {
      j = (int)gamdev(ia, &idum);
      if ((j >= 0) && (j <= 20))
        ++dist[j];
    }
    printf("\ngamma-distribution deviate, order %2d of %6d points\n", ia, 10000);
    printf("%6s %7s %9s \n", "x", "p(x)", "graph:");
    for (j = 0; j < 20; j++) {
      dd = (float)dist[j] / 10000;
      for (k = 1; k <= 50; k++)
        words[k] = ' ';
      klim = (int)(200 * dd);
      if (klim > 50)
        klim = 50;
      for (k = 1; k <= klim; k++)
        words[k] = '*';
      printf("%6d %8.4f  ", j, dd);
      for (k = 1; k <= klim; k++)
        printf("%c", words[k]);
      printf("\n");
    }
  }
  return 0;
}
```