// File: /workspace/github_c_makefile_star2_O0/kobolt[P]curses-collection/scca/scca.c
// Function: display_frequency
static void display_frequency(void)
{
  int count[UCHAR_MAX];
  int i, y, x, maxy, maxx;
  unsigned char c;

  for (c = 0; c < UCHAR_MAX; c++) {
    count[c] = 0;
  }

  for (i = 0; i < TEXT_MAX; i++) {
    if (text[i] == '\0')
      break;
    count[text[i]]++;
  }

  erase();
  getmaxyx(stdscr, maxy, maxx);
  y = x = 0;
  for (c = 0; c < UCHAR_MAX; c++) {
    if (! isupper(c))
      continue;

    mvprintw(y, x, "%c: %d", c, count[c]);
    x += 10;
    if (x > (maxx - 10)) {
      x = 0;
      y++;
    }
  }
  mvprintw(y + 1, 0, "Press any key to contiue...");
  refresh();
  
  flushinp();
  getch(); /* Wait for keypress. */
  flushinp();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x420, %rsp            # imm = 0x420
movb $0x0, -0x415(%rbp)
movzbl -0x415(%rbp), %eax
cmpl $0xff, %eax
jge 0x1cd2
movzbl -0x415(%rbp), %eax
movl $0x0, -0x400(%rbp,%rax,4)
movb -0x415(%rbp), %al
addb $0x1, %al
movb %al, -0x415(%rbp)
jmp 0x1ca2
movl $0x0, -0x404(%rbp)
cmpl $0x10000, -0x404(%rbp)  # imm = 0x10000
jge 0x1d35
movslq -0x404(%rbp), %rcx
leaq 0x391a(%rip), %rax      # 0x5610
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x1d01
jmp 0x1d35
movslq -0x404(%rbp), %rcx
leaq 0x3901(%rip), %rax      # 0x5610
movzbl (%rax,%rcx), %eax
movl -0x400(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x400(%rbp,%rax,4)
movl -0x404(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x404(%rbp)
jmp 0x1cdc
movq 0x3294(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
callq 0x1030
xorl %eax, %eax
movq 0x3283(%rip), %rcx      # 0x4fd0
cmpq (%rcx), %rax
je 0x1d6b
movq 0x3277(%rip), %rax      # 0x4fd0
movq (%rax), %rax
movswl 0x4(%rax), %eax
addl $0x1, %eax
movl %eax, -0x41c(%rbp)
jmp 0x1d78
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x41c(%rbp)
jmp 0x1d78
movl -0x41c(%rbp), %eax
movl %eax, -0x410(%rbp)
xorl %eax, %eax
movq 0x3243(%rip), %rcx      # 0x4fd0
cmpq (%rcx), %rax
je 0x1dab
movq 0x3237(%rip), %rax      # 0x4fd0
movq (%rax), %rax
movswl 0x6(%rax), %eax
addl $0x1, %eax
movl %eax, -0x420(%rbp)
jmp 0x1db8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x420(%rbp)
jmp 0x1db8
movl -0x420(%rbp), %eax
movl %eax, -0x414(%rbp)
movl $0x0, -0x40c(%rbp)
movl $0x0, -0x408(%rbp)
movb $0x0, -0x415(%rbp)
movzbl -0x415(%rbp), %eax
cmpl $0xff, %eax
jge 0x1e93
callq 0x11a0
movq (%rax), %rax
movzbl -0x415(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
jne 0x1e13
jmp 0x1e80
movl -0x408(%rbp), %edi
movl -0x40c(%rbp), %esi
movzbl -0x415(%rbp), %ecx
movzbl -0x415(%rbp), %eax
movl -0x400(%rbp,%rax,4), %r8d
leaq 0x13e7(%rip), %rdx      # 0x3223
movb $0x0, %al
callq 0x1110
movl -0x40c(%rbp), %eax
addl $0xa, %eax
movl %eax, -0x40c(%rbp)
movl -0x40c(%rbp), %eax
movl -0x414(%rbp), %ecx
subl $0xa, %ecx
cmpl %ecx, %eax
jle 0x1e7e
movl $0x0, -0x40c(%rbp)
movl -0x408(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x408(%rbp)
jmp 0x1e80
movb -0x415(%rbp), %al
addb $0x1, %al
movb %al, -0x415(%rbp)
jmp 0x1ddf
movl -0x408(%rbp), %edi
addl $0x1, %edi
xorl %esi, %esi
leaq 0x1362(%rip), %rdx      # 0x3207
movb $0x0, %al
callq 0x1110
movq 0x311d(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
callq 0x10b0
callq 0x1040
movq 0x3109(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
callq 0x1060
callq 0x1040
addq $0x420, %rsp            # imm = 0x420
popq %rbp
retq
nopl (%rax)