// File: /workspace/github_c_makefile_star2_O2/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 0x1df4f
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 0x1de8c
movq 0x10(%rax), %rdx
movq 0x18(%rax), %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0xea69
testb %al, %al
je 0x1df41
cmpl $-0x2, 0x60(%rbp)
jne 0x1dee4
movq 0x8(%r12), %rax
testq %rax, %rax
je 0x1df1e
movl (%rax), %esi
jmp 0x1df21
movq (%rax), %rdx
movq 0x8(%rax), %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0xedb2
testb %al, %al
je 0x1debb
movq 0x8(%r12), %rax
testq %rax, %rax
je 0x1def6
movl 0x64(%rbp), %edx
cmpl $-0x2, %edx
jne 0x1deb7
movl 0x4(%rax), %edx
movl (%rax), %esi
jmp 0x1df02
movq (%r13), %rax
movq 0x10(%rax), %rdx
movq 0x18(%rax), %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0xea69
testb %al, %al
je 0x1df41
movq (%r13), %rax
movq 0x20(%rax), %rax
movq %rax, (%r13)
jmp 0x1df41
movq %r12, %rdi
callq 0x1dd00
pushq $-0x1
popq %rdx
movq %r12, %rdi
movl %eax, %esi
jmp 0x1df27
movl 0x64(%rbp), %edx
cmpl $-0x2, %edx
pushq $-0x1
popq %rsi
cmovel %esi, %edx
movl 0x60(%rbp), %eax
cmpl $-0x2, %eax
cmovnel %eax, %esi
movq %r12, %rdi
movq %r15, %rcx
movq %r14, %r8
callq 0x1dadd
movb $0x1, (%rbx)
jmp 0x1df41
pushq $-0x1
popq %rsi
pushq $-0x1
popq %rdx
movq %r12, %rdi
movq %r15, %rcx
movq %r14, %r8
callq 0x1dadd
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