// File: /workspace/github_c_makefile_star2_O0/kobolt[P]curses-collection/fileselect/fileselect.c
// Function: curses_list_draw
static void curses_list_draw(file_node_t *node, int line_no, int node_no, int selected)
{
  int node_count, maxy, maxx, pos, depth;
  file_node_t *found;

  node_count = 0;
  found = file_node_get_by_node_no(node, node_no, &node_count);
  if (found == NULL)
    return;

  getmaxyx(stdscr, maxy, maxx);

  if (selected)
    attron(A_REVERSE);

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

  } else {
    pos = 0;

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

    /* File/directory name. */
    if (found->marked)
      attron(A_BOLD);
    mvaddstr(line_no, pos, found->name);
    pos += strlen(found->name);
    if (found->marked)
      attroff(A_BOLD);

    /* Slash for directory. */
    if (found->type == FILE_NODE_TYPE_DIR)
      mvaddch(line_no, pos++, '/');

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

  if (selected)
    attroff(A_REVERSE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %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 0x2410
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x214c
jmp 0x2409
xorl %eax, %eax
movq 0x2e83(%rip), %rcx      # 0x4fd8
cmpq (%rcx), %rax
je 0x2170
movq 0x2e77(%rip), %rax      # 0x4fd8
movq (%rax), %rax
movswl 0x4(%rax), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x217a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x34(%rbp)
jmp 0x217a
movl -0x34(%rbp), %eax
movl %eax, -0x1c(%rbp)
xorl %eax, %eax
movq 0x2e4f(%rip), %rcx      # 0x4fd8
cmpq (%rcx), %rax
je 0x21a4
movq 0x2e43(%rip), %rax      # 0x4fd8
movq (%rax), %rax
movswl 0x6(%rax), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x21ae
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x38(%rbp)
jmp 0x21ae
movl -0x38(%rbp), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x21d2
movq 0x2e17(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %eax, %eax
movl %eax, %edx
callq 0x1130
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x2231
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0x20(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x222c
movq 0x2de0(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
callq 0x11c0
cmpl $-0x1, %eax
jne 0x220d
jmp 0x2221
movq 0x2dc4(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movl $0x20, %esi
callq 0x11e0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x21e4
jmp 0x23eb
movl $0x0, -0x24(%rbp)
movq -0x30(%rbp), %rdi
callq 0x24c0
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x28(%rbp)
cmpl $0x1, %eax
jle 0x22c9
movq 0x2d7d(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
callq 0x11c0
cmpl $-0x1, %eax
jne 0x2278
jmp 0x228c
movq 0x2d59(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movl $0x20, %esi
callq 0x11e0
movq 0x2d45(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
callq 0x11c0
cmpl $-0x1, %eax
jne 0x22b0
jmp 0x22c4
movq 0x2d21(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movl $0x20, %esi
callq 0x11e0
jmp 0x2244
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x22ea
movq 0x2cff(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x1130
movq 0x2ce7(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
callq 0x11c0
cmpl $-0x1, %eax
jne 0x2306
jmp 0x2322
movq 0x2ccb(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1200
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x10c0
movq %rax, %rcx
movslq -0x24(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x235d
movq 0x2c8c(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x1210
movq -0x30(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jne 0x239f
movq 0x2c6a(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
callq 0x11c0
cmpl $-0x1, %eax
jne 0x238b
jmp 0x239f
movq 0x2c46(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movl $0x2f, %esi
callq 0x11e0
jmp 0x23a1
movl -0x24(%rbp), %eax
movl -0x20(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x23e9
movq 0x2c23(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x24(%rbp), %edx
callq 0x11c0
cmpl $-0x1, %eax
jne 0x23ca
jmp 0x23de
movq 0x2c07(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movl $0x20, %esi
callq 0x11e0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x23a1
jmp 0x23eb
cmpl $0x0, -0x14(%rbp)
je 0x2409
movq 0x2be0(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %eax, %eax
movl %eax, %edx
callq 0x1210
addq $0x40, %rsp
popq %rbp
retq
nop