// File: /workspace/github_c_makefile_star2_O0/kobolt[P]curses-collection/difftree/navi.c
// Function: diff_navi_update_screen
static void diff_navi_update_screen(diff_node_t *node)
{
  int n, i, maxy, maxx;
  int scrollbar_size, scrollbar_pos;
  int list_size;

  list_size = diff_navi_list_size(node);

  getmaxyx(stdscr, maxy, maxx);
  erase();

  /* Draw text lines. */
  for (n = 0; n < maxy; n++) {
    if ((n + scroll_offset) >= list_size)
      break;

    if (n == (selected_entry - scroll_offset)) {
      diff_navi_list_draw(node, n, n + scroll_offset + 1, 1);
    } else {
      diff_navi_list_draw(node, n, n + scroll_offset + 1, 0);
    }
  }

  /* Draw scrollbar. */
  if (list_size <= maxy)
    scrollbar_size = maxy;
  else
    scrollbar_size = maxy / (list_size / (double)maxy);

  scrollbar_pos = selected_entry / (double)list_size * (maxy - scrollbar_size);
  attron(A_REVERSE);
  for (i = 0; i <= scrollbar_size; i++)
    mvaddch(i + scrollbar_pos, maxx - 1, ' ');
  attroff(A_REVERSE);

  mvvline(0, maxx - 2, 0, maxy);

  /* Place cursor at end of selected line. */
  move(selected_entry - scroll_offset, maxx - 3);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x36d0
movl %eax, -0x24(%rbp)
xorl %eax, %eax
movq 0x3867(%rip), %rcx      # 0x6fd8
cmpq (%rcx), %rax
je 0x378c
movq 0x385b(%rip), %rax      # 0x6fd8
movq (%rax), %rax
movswl 0x4(%rax), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x3796
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x28(%rbp)
jmp 0x3796
movl -0x28(%rbp), %eax
movl %eax, -0x14(%rbp)
xorl %eax, %eax
movq 0x3833(%rip), %rcx      # 0x6fd8
cmpq (%rcx), %rax
je 0x37c0
movq 0x3827(%rip), %rax      # 0x6fd8
movq (%rax), %rax
movswl 0x6(%rax), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x37ca
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x2c(%rbp)
jmp 0x37ca
movl -0x2c(%rbp), %eax
movl %eax, -0x18(%rbp)
movq 0x3801(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
callq 0x2050
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x3857
movl -0xc(%rbp), %eax
addl 0x3991(%rip), %eax      # 0x7188
cmpl -0x24(%rbp), %eax
jl 0x37fe
jmp 0x3857
movl -0xc(%rbp), %eax
movl 0x397d(%rip), %ecx      # 0x7184
subl 0x397b(%rip), %ecx      # 0x7188
cmpl %ecx, %eax
jne 0x3830
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0xc(%rbp), %edx
addl 0x3967(%rip), %edx      # 0x7188
addl $0x1, %edx
movl $0x1, %ecx
callq 0x3c40
jmp 0x384a
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0xc(%rbp), %edx
addl 0x3948(%rip), %edx      # 0x7188
addl $0x1, %edx
xorl %ecx, %ecx
callq 0x3c40
jmp 0x384c
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x37e6
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
jg 0x3867
movl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x3885
cvtsi2sdl -0x14(%rbp), %xmm0
cvtsi2sdl -0x24(%rbp), %xmm1
cvtsi2sdl -0x14(%rbp), %xmm2
divsd %xmm2, %xmm1
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x1c(%rbp)
cvtsi2sdl 0x38f7(%rip), %xmm0 # 0x7184
cvtsi2sdl -0x24(%rbp), %xmm1
divsd %xmm1, %xmm0
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x20(%rbp)
movq 0x3726(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %eax, %eax
movl %eax, %edx
callq 0x21b0
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jg 0x3913
movq 0x36ff(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl -0x10(%rbp), %esi
addl -0x20(%rbp), %esi
movl -0x18(%rbp), %edx
subl $0x1, %edx
callq 0x2260
cmpl $-0x1, %eax
jne 0x38f4
jmp 0x3908
movq 0x36dd(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x20, %esi
callq 0x2280
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x38ca
movq 0x36be(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %eax, %eax
movl %eax, %edx
callq 0x22d0
movq 0x36a6(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl -0x18(%rbp), %edx
subl $0x2, %edx
xorl %esi, %esi
callq 0x2260
cmpl $-0x1, %eax
jne 0x3949
jmp 0x395d
movq 0x3688(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl -0x14(%rbp), %edx
xorl %esi, %esi
callq 0x2250
movq 0x3674(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl 0x3817(%rip), %esi      # 0x7184
subl 0x3815(%rip), %esi      # 0x7188
movl -0x18(%rbp), %edx
subl $0x3, %edx
callq 0x2260
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)