// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_syntax.c
// Function: ce_syntax_highlight_visual
void ce_syntax_highlight_visual(CeRangeNode_t** range_node, bool* in_visual, CePoint_t point, CeDrawColorList_t* draw_color_list,
                                CeSyntaxDef_t* syntax_defs){
     if(*range_node){
          if(*in_visual){
               if(ce_point_after(point, (*range_node)->range.end)){
                    if(syntax_defs[CE_SYNTAX_COLOR_VISUAL].fg == CE_SYNTAX_USE_CURRENT_COLOR){
                         // if the syntax def for visual fg is use current color, then keep that one
                         ce_draw_color_list_insert(draw_color_list, ce_draw_color_list_last_fg_color(draw_color_list),
                                                   CE_COLOR_DEFAULT, point);
                    }else{
                         // use the 2nd to last color, because we have been overriding each color with visual colors
                         ce_draw_color_list_insert(draw_color_list, ce_draw_color_list_next_to_last_fg_color(draw_color_list),
                                                   CE_COLOR_DEFAULT, point);
                    }

                    *range_node = (*range_node)->next;
                    *in_visual = false;
               }
          }else{
               if(ce_points_equal(point, (*range_node)->range.start)){
                    int bg = ce_syntax_def_get_bg(syntax_defs, CE_SYNTAX_COLOR_VISUAL, ce_draw_color_list_last_bg_color(draw_color_list));
                    int fg = ce_syntax_def_get_fg(syntax_defs, CE_SYNTAX_COLOR_VISUAL, ce_draw_color_list_last_fg_color(draw_color_list));
                    ce_draw_color_list_insert(draw_color_list, fg, bg, point);
                    *in_visual = true;
               }else if(ce_point_after(point, (*range_node)->range.end)){
                    *range_node = (*range_node)->next;
               }
          }
     }
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x1fdac
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbp
movq %r8, %r12
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r13
cmpb $0x1, (%rsi)
jne 0x1fcce
movq 0x10(%rax), %rdx
movq 0x18(%rax), %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0xec71
testb %al, %al
je 0x1fd9e
cmpl $-0x2, 0x60(%rbp)
movq 0x8(%r12), %rax
jne 0x1fd2a
testq %rax, %rax
je 0x1fd77
movl (%rax), %esi
jmp 0x1fd7c
movq (%rax), %rdx
movq 0x8(%rax), %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0xf03d
testb %al, %al
je 0x1fcfd
movq 0x8(%r12), %rax
testq %rax, %rax
je 0x1fd4d
movl 0x64(%rbp), %edx
cmpl $-0x2, %edx
jne 0x1fcf9
movl 0x4(%rax), %edx
movl (%rax), %esi
jmp 0x1fd5b
movq (%r13), %rax
movq 0x10(%rax), %rdx
movq 0x18(%rax), %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0xec71
testb %al, %al
je 0x1fd9e
movq (%r13), %rax
movq 0x20(%rax), %rax
movq %rax, (%r13)
jmp 0x1fd9e
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x1fd7c
movq (%r12), %rcx
cmpq %rax, %rcx
je 0x1fd7c
movq %rcx, %rdx
movq 0x18(%rcx), %rcx
cmpq %rax, %rcx
jne 0x1fd3d
movl (%rdx), %esi
jmp 0x1fd7c
movl 0x64(%rbp), %edx
cmpl $-0x2, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
cmovel %esi, %edx
movl 0x60(%rbp), %eax
cmpl $-0x2, %eax
cmovnel %eax, %esi
movq %r12, %rdi
movq %r15, %rcx
movq %r14, %r8
callq 0x1f8e9
movb $0x1, (%rbx)
jmp 0x1fd9e
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r12, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r15, %rcx
movq %r14, %r8
callq 0x1f8e9
movq (%r13), %rax
movq 0x20(%rax), %rax
movq %rax, (%r13)
movb $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq