// File: /workspace/github_c_makefile_star2_O0/kobolt[P]curses-collection/difftree/navi.c
// Function: diff_navi_list_draw
static void diff_navi_list_draw(diff_node_t *node, int line_no, int node_no, int selected)
{
  int size, maxy, maxx, pos, depth;
  diff_node_t *found;

  size = 0;
  found = diff_navi_node_get(node, node_no, &size);
  if (found == NULL)
    return;

  getmaxyx(stdscr, maxy, maxx);

  if (selected)
    attron(A_REVERSE);

  /* Color. */
  switch (found->type) {
  case DIFF_TYPE_FILE_EQUAL:
  case DIFF_TYPE_DIR_EQUAL:
    if (selected) {
      attrset(COLOR_PAIR(COLOR_SELECTED_EQUAL));
    } else {
      attrset(COLOR_PAIR(COLOR_EQUAL));
    }
    break;

  case DIFF_TYPE_FILE_DIFFERS:
  case DIFF_TYPE_DIR_DIFFERS:
    if (selected) {
      attrset(COLOR_PAIR(COLOR_SELECTED_DIFFERS));
    } else {
      attrset(COLOR_PAIR(COLOR_DIFFERS));
    }
    break;

  case DIFF_TYPE_FILE_ADDED:
  case DIFF_TYPE_DIR_ADDED:
    if (selected) {
      attrset(COLOR_PAIR(COLOR_SELECTED_ADDED));
    } else {
      attrset(COLOR_PAIR(COLOR_ADDED));
    }
    break;

  case DIFF_TYPE_FILE_MISSING:
  case DIFF_TYPE_DIR_MISSING:
    if (selected) {
      attrset(COLOR_PAIR(COLOR_SELECTED_MISSING));
    } else {
      attrset(COLOR_PAIR(COLOR_MISSING));
    }
    break;

  default:
    break;
  }

  if (found->name == NULL) {
    for (pos = 0; pos < maxx - 2; pos++)
      mvaddch(line_no, pos, ' ');

  } else {

    pos = 0;

    /* Depth indicator. */
    depth = diff_node_depth(found);
    while (depth-- > 1) {
      mvaddch(line_no, pos++, ' ');
      mvaddch(line_no, pos++, ' ');
    }

    /* Type indicator. */
    switch (found->type) {
    case DIFF_TYPE_FILE_EQUAL:
    case DIFF_TYPE_DIR_EQUAL:
      mvaddch(line_no, pos++, '=');
      break;

    case DIFF_TYPE_FILE_DIFFERS:
    case DIFF_TYPE_DIR_DIFFERS:
      mvaddch(line_no, pos++, '*');
      break;

    case DIFF_TYPE_FILE_ADDED:
    case DIFF_TYPE_DIR_ADDED:
      mvaddch(line_no, pos++, '+');
      break;

    case DIFF_TYPE_FILE_MISSING:
    case DIFF_TYPE_DIR_MISSING:
      mvaddch(line_no, pos++, '-');
      break;

    default:
      break;
    }

    /* File/directory name. */
    mvaddstr(line_no, pos, found->name);
    pos += strlen(found->name);

    /* Slash for directory. */
    switch (found->type) {
    case DIFF_TYPE_DIR_EQUAL:
    case DIFF_TYPE_DIR_DIFFERS:
    case DIFF_TYPE_DIR_ADDED:
    case DIFF_TYPE_DIR_MISSING:
      mvaddch(line_no, pos++, '/');
      break;

    default:
      break;
    }

    /* Arrow when not expanded. */
    if (! found->expanded) {
      mvaddch(line_no, pos++, ' ');
      mvaddch(line_no, pos++, '-');
      mvaddch(line_no, pos++, '>');
    }

    /* Padding. */
    for (; pos < maxx - 2; pos++)
      mvaddch(line_no, pos, ' ');
  }

  if (selected)
    attroff(A_REVERSE);

  attrset(COLOR_PAIR(COLOR_EQUAL));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %esi
leaq -0x18(%rbp), %rdx
callq 0x41f0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x3c7c
jmp 0x41db
xorl %eax, %eax
movq 0x3353(%rip), %rcx      # 0x6fd8
cmpq (%rcx), %rax
je 0x3ca0
movq 0x3347(%rip), %rax      # 0x6fd8
movq (%rax), %rax
movswl 0x4(%rax), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x3caa
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x34(%rbp)
jmp 0x3caa
movl -0x34(%rbp), %eax
movl %eax, -0x1c(%rbp)
xorl %eax, %eax
movq 0x331f(%rip), %rcx      # 0x6fd8
cmpq (%rcx), %rax
je 0x3cd4
movq 0x3313(%rip), %rax      # 0x6fd8
movq (%rax), %rax
movswl 0x6(%rax), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x3cde
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x38(%rbp)
jmp 0x3cde
movl -0x38(%rbp), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x3d02
movq 0x32e7(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %eax, %eax
movl %eax, %edx
callq 0x21b0
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x40(%rbp)
subl $0x7, %eax
ja 0x3df9
movq -0x40(%rbp), %rax
leaq 0x1383(%rip), %rcx      # 0x50a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, -0x14(%rbp)
je 0x3d4a
movq 0x329d(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x500, %esi            # imm = 0x500
callq 0x2040
jmp 0x3d5e
movq 0x3287(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x2040
jmp 0x3dfb
cmpl $0x0, -0x14(%rbp)
je 0x3d7f
movq 0x3268(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x600, %esi            # imm = 0x600
callq 0x2040
jmp 0x3d93
movq 0x3252(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x2040
jmp 0x3dfb
cmpl $0x0, -0x14(%rbp)
je 0x3db1
movq 0x3236(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x700, %esi            # imm = 0x700
callq 0x2040
jmp 0x3dc5
movq 0x3220(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x300, %esi            # imm = 0x300
callq 0x2040
jmp 0x3dfb
cmpl $0x0, -0x14(%rbp)
je 0x3de3
movq 0x3204(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x800, %esi            # imm = 0x800
callq 0x2040
jmp 0x3df7
movq 0x31ee(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x2040
jmp 0x3dfb
jmp 0x3dfb
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x3e5a
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0x20(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x3e55
movq 0x31b7(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
callq 0x2260
cmpl $-0x1, %eax
jne 0x3e36
jmp 0x3e4a
movq 0x319b(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x20, %esi
callq 0x2280
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x3e0d
jmp 0x41a9
movl $0x0, -0x24(%rbp)
movq -0x30(%rbp), %rdi
callq 0x25c0
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x28(%rbp)
cmpl $0x1, %eax
jle 0x3ef2
movq 0x3154(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
callq 0x2260
cmpl $-0x1, %eax
jne 0x3ea1
jmp 0x3eb5
movq 0x3130(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x20, %esi
callq 0x2280
movq 0x311c(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
callq 0x2260
cmpl $-0x1, %eax
jne 0x3ed9
jmp 0x3eed
movq 0x30f8(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x20, %esi
callq 0x2280
jmp 0x3e6d
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x48(%rbp)
subl $0x7, %eax
ja 0x4009
movq -0x48(%rbp), %rax
leaq 0x11b3(%rip), %rcx      # 0x50c8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x30b3(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
callq 0x2260
cmpl $-0x1, %eax
jne 0x3f42
jmp 0x3f56
movq 0x308f(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x3d, %esi
callq 0x2280
jmp 0x400b
movq 0x3076(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
callq 0x2260
cmpl $-0x1, %eax
jne 0x3f7f
jmp 0x3f93
movq 0x3052(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x2a, %esi
callq 0x2280
jmp 0x400b
movq 0x303c(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
callq 0x2260
cmpl $-0x1, %eax
jne 0x3fb9
jmp 0x3fcd
movq 0x3018(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x2b, %esi
callq 0x2280
jmp 0x400b
movq 0x3002(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
callq 0x2260
cmpl $-0x1, %eax
jne 0x3ff3
jmp 0x4007
movq 0x2fde(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x2d, %esi
callq 0x2280
jmp 0x400b
jmp 0x400b
movq 0x2fc6(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
callq 0x2260
cmpl $-0x1, %eax
jne 0x4027
jmp 0x4043
movq 0x2faa(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x22b0
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x20f0
movq %rax, %rcx
movl -0x24(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x24(%rbp)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
addl $-0x5, %eax
subl $0x3, %eax
ja 0x40a6
jmp 0x406c
movq 0x2f65(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
callq 0x2260
cmpl $-0x1, %eax
jne 0x4090
jmp 0x40a4
movq 0x2f41(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x2f, %esi
callq 0x2280
jmp 0x40a8
jmp 0x40a8
movq -0x30(%rbp), %rax
testb $0x1, (%rax)
jne 0x415d
movq 0x2f1c(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
callq 0x2260
cmpl $-0x1, %eax
jne 0x40d9
jmp 0x40ed
movq 0x2ef8(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x20, %esi
callq 0x2280
movq 0x2ee4(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
callq 0x2260
cmpl $-0x1, %eax
jne 0x4111
jmp 0x4125
movq 0x2ec0(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x2d, %esi
callq 0x2280
movq 0x2eac(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
callq 0x2260
cmpl $-0x1, %eax
jne 0x4149
jmp 0x415d
movq 0x2e88(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x3e, %esi
callq 0x2280
jmp 0x415f
movl -0x24(%rbp), %eax
movl -0x20(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x41a7
movq 0x2e65(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
callq 0x2260
cmpl $-0x1, %eax
jne 0x4188
jmp 0x419c
movq 0x2e49(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x20, %esi
callq 0x2280
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x415f
jmp 0x41a9
cmpl $0x0, -0x14(%rbp)
je 0x41c7
movq 0x2e22(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %eax, %eax
movl %eax, %edx
callq 0x22d0
movq 0x2e0a(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x2040
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)