// File: /workspace/github_c_makefile_star2_O3/justy989[P]ce/ce_syntax.c
// Function: ce_syntax_highlight_plain
void ce_syntax_highlight_plain(CeView_t* view, CeRangeList_t* highlight_range_list, CeDrawColorList_t* draw_color_list,
                               CeSyntaxDef_t* syntax_defs, void* user_data){
     if(!view->buffer) return;
     if(view->buffer->line_count <= 0) return;
     int64_t min = view->scroll.y;
     int64_t max = min + (view->rect.bottom - view->rect.top);
     int64_t clamp_max = (view->buffer->line_count - 1);
     if(clamp_max < 0) clamp_max = 0;
     CE_CLAMP(min, 0, clamp_max);
     CE_CLAMP(max, 0, clamp_max);
     bool in_visual = false;
     CeRangeNode_t* range_node = highlight_range_list->head;

     check_visual_start(range_node, min, draw_color_list, syntax_defs, &in_visual);

     for(int64_t y = min; y <= max; ++y){
          char* line = view->buffer->lines[y];
          int64_t line_len = ce_utf8_strlen(line);
          CePoint_t match_point = {0, y};

          if(in_visual && line_len == 0) change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_VISUAL, match_point);

          if(in_visual){
               int bg = ce_syntax_def_get_bg(syntax_defs, CE_SYNTAX_COLOR_VISUAL, ce_draw_color_list_last_bg_color(draw_color_list));
               ce_draw_color_list_insert(draw_color_list, ce_draw_color_list_last_fg_color(draw_color_list), bg, match_point);
          }

          for(int64_t x = 0; x < line_len; ++x){
               match_point.x = x;
               ce_syntax_highlight_visual(&range_node, &in_visual, match_point, draw_color_list, syntax_defs);
               if(in_visual) change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_VISUAL, match_point);
          }

          check_visual_mode_end(range_node, &in_visual, match_point.y, line_len, draw_color_list);
     }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x8(%rsp)
movq 0x40(%rdi), %rax
testq %rax, %rax
je 0x22487
movq 0x8(%rax), %r13
testq %r13, %r13
jle 0x22487
movq %rcx, %rbx
movq %rdx, %r14
movq 0x8(%rsp), %rdx
movq 0x18(%rdx), %rax
movq 0x28(%rdx), %rcx
subq 0x10(%rdx), %rax
addq %rcx, %rax
decq %r13
cmpq %r13, %rcx
movq %r13, %r12
cmovlq %rcx, %r12
xorl %edx, %edx
testq %rcx, %rcx
cmovsq %rdx, %r12
cmpq %r13, %rax
cmovlq %rax, %r13
testq %rax, %rax
cmovsq %rdx, %r13
leaq 0x7(%rsp), %r8
movb $0x0, (%r8)
movq (%rsi), %rdi
movq %rdi, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1fbd2
cmpq %r13, %r12
jg 0x22487
leaq 0x7(%rsp), %rbp
movq %r13, 0x20(%rsp)
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq (%rax,%r12,8), %rdi
callq 0xe445
movq %rax, %r15
movb 0x7(%rsp), %al
cmpb $0x1, %al
jne 0x223d4
testq %r15, %r15
jne 0x223d4
movq %r14, %rdi
movq %rbx, %rsi
movl $0xc, %edx
xorl %ecx, %ecx
movq %r12, %r8
callq 0x203f4
movb 0x7(%rsp), %al
testb $0x1, %al
je 0x2240b
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x223f0
movl 0x64(%rbx), %edx
cmpl $-0x2, %edx
jne 0x223ec
movl 0x4(%rax), %edx
movl (%rax), %esi
jmp 0x223fe
movl 0x64(%rbx), %edx
cmpl $-0x2, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
cmovel %esi, %edx
movq %r14, %rdi
xorl %ecx, %ecx
movq %r12, %r8
callq 0x1f8e9
testq %r15, %r15
jle 0x22460
xorl %r13d, %r13d
leaq 0x18(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq %r14, %r8
movq %rbx, %r9
callq 0x1fc6a
cmpb $0x1, 0x7(%rsp)
jne 0x22449
movq %r14, %rdi
movq %rbx, %rsi
movl $0xc, %edx
movq %r13, %rcx
movq %r12, %r8
callq 0x203f4
incq %r13
cmpq %r13, %r15
jne 0x22413
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %r13
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0x1fdad
leaq 0x1(%r12), %rax
cmpq %r13, %r12
movq %rax, %r12
jne 0x22396
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq