// File: /workspace/github_c_makefile_star2_O2/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, %r13
movq %rdx, 0x18(%rsp)
movq %rsi, %r15
movq %rdi, %r14
movl 0x80(%rsp), %edx
addl 0x18(%rdi), %r13d
movq %rcx, 0x8(%rsp)
movq %rcx, %rdi
movl %r9d, 0x4(%rsp)
movl %r9d, %esi
callq 0x1dd23
movq 0x1fe89(%rip), %rbx     # 0x38f90
movq (%rbx), %rdi
shll $0x8, %eax
movzwl %ax, %esi
xorl %ebp, %ebp
xorl %edx, %edx
callq 0xd0f0
movq (%r14), %rdx
movq 0x8(%r14), %r12
subq %rdx, %r12
movq (%rbx), %rdi
movq %r13, 0x10(%rsp)
movl %r13d, %esi
callq 0xd070
pushq $0x20
popq %r13
cmpq %r12, %rbp
jg 0x1914c
movq (%rbx), %rdi
movl %r13d, %esi
callq 0xd620
incq %rbp
jmp 0x19137
testq %r15, %r15
je 0x19205
movl (%r15), %eax
cmpq $0x5, %rax
ja 0x19205
leaq 0x134ff(%rip), %rcx     # 0x2c668
movl (%rcx,%rax,4), %esi
leaq 0x1350d(%rip), %rcx     # 0x2c680
movslq (%rcx,%rax,4), %r13
addq %rcx, %r13
movq 0x8(%rsp), %rbp
movq %rbp, %rdi
movl 0x80(%rsp), %edx
callq 0x1dd23
movq (%rbx), %rdi
shll $0x8, %eax
movl $0xffff, %r15d          # imm = 0xFFFF
andl %r15d, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0xd0f0
movl (%r14), %esi
incl %esi
leaq 0x14754(%rip), %rdx     # 0x2d906
movq 0x10(%rsp), %r12
movl %r12d, %edi
movq %r13, %rcx
xorl %eax, %eax
callq 0xd600
movq %rbp, %rdi
movl 0x4(%rsp), %esi
movl 0x80(%rsp), %edx
callq 0x1dd23
movq (%rbx), %rdi
shll $0x8, %eax
andl %eax, %r15d
movl %r15d, %esi
xorl %r15d, %r15d
xorl %edx, %edx
callq 0xd0f0
movq 0x40(%r14), %rax
movq 0x10(%rax), %rsi
leaq 0x12b5c(%rip), %rdi     # 0x2bd58
xorl %eax, %eax
callq 0xd4d0
jmp 0x19250
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
movl 0x80(%rsp), %edx
callq 0x1dd23
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 0x146c8(%rip), %rdx     # 0x2d906
movq 0x10(%rsp), %r12
movl %r12d, %edi
xorl %eax, %eax
callq 0xd600
movb $0x1, %r15b
movq 0x40(%r14), %rax
movl 0x18(%rax), %edi
callq 0xfa3e
testq %rax, %rax
movq 0x18(%rsp), %rbx
je 0x19277
leaq 0x14699(%rip), %rdi     # 0x2d906
movq %rax, %rsi
xorl %eax, %eax
callq 0xd4d0
testb %r15b, %r15b
jne 0x192be
movq %rbx, %rdi
callq 0x1d5ea
testb %al, %al
je 0x1929d
movzbl 0x2f8(%rbx), %esi
leaq 0x13386(%rip), %rdi     # 0x2c61c
xorl %eax, %eax
callq 0xd4d0
leaq 0x22868(%rip), %rbx     # 0x3bb0c
movl (%rbx), %edi
callq 0xd6b0
movl (%rbx), %edx
leaq 0x13376(%rip), %rdi     # 0x2c62a
movq %rax, %rsi
xorl %eax, %eax
callq 0xd4d0
movq 0x30(%r14), %rcx
movq 0x38(%r14), %r8
incq %rcx
incq %r8
leaq 0x1335f(%rip), %rdx     # 0x2c632
leaq 0x20(%rsp), %r15
pushq $0x20
popq %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0xd260
notl %eax
addl 0x8(%r14), %eax
leaq 0x14614(%rip), %rdx     # 0x2d906
movl %r12d, %edi
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