// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_draw_term.c
// Function: draw_view_status
void _draw_view_status(CeView_t* view, CeVim_t* vim, CeMacros_t* macros,
                       CeColorDefs_t* color_defs, int64_t height_offset, int ui_fg_color, int ui_bg_color){
     // create bottom bar bg
     int64_t bottom = view->rect.bottom + height_offset;
     int color_pair = ce_color_def_get(color_defs, ui_fg_color, ui_bg_color);
     attron(COLOR_PAIR(color_pair));
     int64_t width = (view->rect.right - view->rect.left) + 1;
     move(bottom, view->rect.left);
     for(int64_t i = 0; i < width; ++i){
          addch(' ');
     }

     // set the mode line
     int vim_mode_fg = ui_fg_color;
     const char* vim_mode_string = NULL;

     if(vim){
          switch(vim->mode){
          default:
               break;
          case CE_VIM_MODE_NORMAL:
               vim_mode_string = "NORMAL";
               vim_mode_fg = CE_COLOR_BLUE;
               break;
          case CE_VIM_MODE_INSERT:
               vim_mode_string = "INSERT";
               vim_mode_fg = CE_COLOR_GREEN;
               break;
          case CE_VIM_MODE_VISUAL:
               vim_mode_string = "VISUAL";
               vim_mode_fg = CE_COLOR_YELLOW;
               break;
          case CE_VIM_MODE_VISUAL_LINE:
               vim_mode_string = "VISUAL LINE";
               vim_mode_fg = CE_COLOR_BRIGHT_YELLOW;
               break;
          case CE_VIM_MODE_VISUAL_BLOCK:
               vim_mode_string = "VISUAL BLOCK";
               vim_mode_fg = CE_COLOR_BRIGHT_YELLOW;
               break;
          case CE_VIM_MODE_REPLACE:
               vim_mode_string = "REPLACE";
               vim_mode_fg = CE_COLOR_RED;
               break;
          }
     }

     if(vim_mode_string){
          color_pair = ce_color_def_get(color_defs, vim_mode_fg, ui_bg_color);
          attron(COLOR_PAIR(color_pair));
          mvprintw(bottom, view->rect.left + 1, "%s", vim_mode_string);

          color_pair = ce_color_def_get(color_defs, ui_fg_color, ui_bg_color);
          attron(COLOR_PAIR(color_pair));
          printw(" %s", view->buffer->name);
     }else{
          color_pair = ce_color_def_get(color_defs, ui_fg_color, ui_bg_color);
          attron(COLOR_PAIR(color_pair));
          mvprintw(bottom, view->rect.left + 1, "%s", view->buffer->name);
     }

     const char* status_str = ce_buffer_status_get_str(view->buffer->status);
     if(status_str) printw("%s", status_str);

     if(vim_mode_string && ce_macros_is_recording(macros)){
          printw(" RECORDING %c", macros->recording);
     }

#ifdef ENABLE_DEBUG_KEY_PRESS_INFO
     if(vim_mode_string) printw(" %s %d ", keyname(g_last_key), g_last_key);
#endif

     char cursor_pos_string[32];
     int64_t cursor_pos_string_len = snprintf(cursor_pos_string, 32, "%"PRId64", %"PRId64"", view->cursor.x + 1, view->cursor.y + 1);
     mvprintw(bottom, view->rect.right - (cursor_pos_string_len + 1), "%s", cursor_pos_string);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, %r12
movq %rdx, 0x18(%rsp)
movq %rsi, %r15
movq %rdi, %r14
movl 0x80(%rsp), %edx
addl 0x18(%rdi), %r12d
movq %rcx, 0x10(%rsp)
movq %rcx, %rdi
movl %r9d, 0x4(%rsp)
movl %r9d, %esi
callq 0x1fbe9
movq 0x20c0d(%rip), %rbx     # 0x3af90
movq (%rbx), %rdi
shll $0x8, %eax
movzwl %ax, %esi
xorl %edx, %edx
callq 0xd0f0
movq (%r14), %r13
movq 0x8(%r14), %rbp
movq (%rbx), %rdi
movq %r12, 0x8(%rsp)
movl %r12d, %esi
movl %r13d, %edx
callq 0xd070
subq %r13, %rbp
jl 0x1a3c7
incq %rbp
movq (%rbx), %rdi
movl $0x20, %esi
callq 0xd620
decq %rbp
jne 0x1a3b5
movb $0x1, %r13b
testq %r15, %r15
je 0x1a3ff
movl (%r15), %eax
cmpq $0x5, %rax
movl 0x4(%rsp), %r12d
ja 0x1a5f0
leaq 0x16204(%rip), %rcx     # 0x305ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1620c(%rip), %rbp     # 0x30604
movl $0x4, %esi
jmp 0x1a44a
xorl %ebp, %ebp
movl 0x4(%rsp), %r12d
movl %r12d, %esi
jmp 0x1a44d
leaq 0x16213(%rip), %rbp     # 0x30625
jmp 0x1a429
leaq 0x161f7(%rip), %rbp     # 0x30612
movl $0x3, %esi
jmp 0x1a44a
leaq 0x161f0(%rip), %rbp     # 0x30619
movl $0xb, %esi
jmp 0x1a44a
leaq 0x161d4(%rip), %rbp     # 0x3060b
movl $0x2, %esi
jmp 0x1a44a
leaq 0x161ed(%rip), %rbp     # 0x30632
movl $0x1, %esi
xorl %r13d, %r13d
testb %r13b, %r13b
je 0x1a49b
movq 0x10(%rsp), %rdi
movl %r12d, %esi
movl 0x80(%rsp), %edx
callq 0x1fbe9
movq (%rbx), %rdi
shll $0x8, %eax
movzwl %ax, %esi
xorl %edx, %edx
callq 0xd0f0
movl (%r14), %esi
incl %esi
movq 0x40(%r14), %rax
movq 0x10(%rax), %rcx
leaq 0x17432(%rip), %rdx     # 0x318bc
movq 0x8(%rsp), %rdi
xorl %eax, %eax
callq 0xd600
jmp 0x1a527
movq 0x10(%rsp), %r15
movq %r15, %rdi
movl 0x80(%rsp), %edx
callq 0x1fbe9
movq (%rbx), %rdi
shll $0x8, %eax
movl %r13d, 0x4(%rsp)
movl $0xffff, %r13d          # imm = 0xFFFF
andl %r13d, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0xd0f0
movl (%r14), %esi
incl %esi
leaq 0x173e4(%rip), %rdx     # 0x318bc
movq 0x8(%rsp), %rdi
movq %rbp, %rcx
xorl %eax, %eax
callq 0xd600
movq %r15, %rdi
movl %r12d, %esi
movl 0x80(%rsp), %edx
callq 0x1fbe9
movq (%rbx), %rdi
shll $0x8, %eax
andl %eax, %r13d
movl %r13d, %esi
movl 0x4(%rsp), %r13d
xorl %edx, %edx
callq 0xd0f0
movq 0x40(%r14), %rax
movq 0x10(%rax), %rsi
leaq 0x15838(%rip), %rdi     # 0x2fd58
xorl %eax, %eax
callq 0xd4d0
movq 0x40(%r14), %rax
movl 0x18(%rax), %edi
callq 0xff0b
testq %rax, %rax
movq 0x18(%rsp), %rbx
je 0x1a54e
leaq 0x17378(%rip), %rdi     # 0x318bc
movq %rax, %rsi
xorl %eax, %eax
callq 0xd4d0
testb %r13b, %r13b
jne 0x1a59a
movq %rbx, %rdi
callq 0x1f3e8
testb %al, %al
je 0x1a574
movzbl 0x2f8(%rbx), %esi
leaq 0x160cd(%rip), %rdi     # 0x3063a
xorl %eax, %eax
callq 0xd4d0
testb %r13b, %r13b
jne 0x1a59a
leaq 0x2358c(%rip), %rbx     # 0x3db0c
movl (%rbx), %edi
callq 0xd6b0
movl (%rbx), %edx
leaq 0x160b8(%rip), %rdi     # 0x30648
movq %rax, %rsi
xorl %eax, %eax
callq 0xd4d0
movq 0x30(%r14), %rcx
movq 0x38(%r14), %r8
incq %rcx
incq %r8
leaq 0x160a1(%rip), %rdx     # 0x30650
leaq 0x20(%rsp), %r15
movl $0x20, %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0xd260
notl %eax
addl 0x8(%r14), %eax
leaq 0x172ec(%rip), %rdx     # 0x318bc
movq 0x8(%rsp), %rdi
movl %eax, %esi
movq %r15, %rcx
xorl %eax, %eax
callq 0xd600
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x1a406