// File: /workspace/github_c_makefile_star2_O1/justy989[P]ce/ce_syntax.c
// Function: ce_syntax_highlight_java
void ce_syntax_highlight_java(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);
     int64_t match_len = 0;
     bool multiline_comment = false;
     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);
          int64_t current_match_len = 1;
          CePoint_t match_point = {0, y};

          if(multiline_comment){
               change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_COMMENT, match_point);
          }

          ce_syntax_highlight_visual(&range_node, &in_visual, match_point, draw_color_list, syntax_defs);

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

          for(int64_t x = 0; x < line_len; ++x){
               char* str = ce_utf8_iterate_to(line, x);
               match_point.x = x;

               ce_syntax_highlight_visual(&range_node, &in_visual, match_point, draw_color_list, syntax_defs);

               if(current_match_len <= 1){
                    if(multiline_comment){
                         if((match_len = match_c_multiline_comment_end(str))){
                              multiline_comment = false;
                         }
                    }else{
                         if((match_len = match_java_type(str, line))){
                              change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_TYPE, match_point);
                         }else if((match_len = match_java_keyword(str, line))){
                              change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_KEYWORD, match_point);
                         }else if((match_len = match_java_control(str, line))){
                              change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_CONTROL, match_point);
                         }else if((match_len = match_caps_var(str, line))){
                              change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_CAPS_VAR, match_point);
                         }else if((match_len = match_c_comment(str))){
                              change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_COMMENT, match_point);
                         }else if((match_len = match_c_string(str))){
                              change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_STRING, match_point);
                         }else if((match_len = match_c_character_literal(str))){
                              change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_CHAR_LITERAL, match_point);
                         }else if((match_len = match_c_literal(str, line))){
                              change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_NUMBER_LITERAL, match_point);
                         }else if((match_len = match_c_multiline_comment(str))){
                              change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_COMMENT, match_point);
                              multiline_comment = true;
                         }else if(((view->cursor.y != y) || (x > view->cursor.x)) && (match_len = match_trailing_whitespace(str))){
                              change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_TRAILING_WHITESPACE, match_point);
                              ce_draw_color_list_insert(draw_color_list, ce_syntax_def_get_fg(syntax_defs, CE_SYNTAX_COLOR_NORMAL, CE_COLOR_DEFAULT),
                                                        ce_syntax_def_get_bg(syntax_defs, CE_SYNTAX_COLOR_NORMAL, CE_COLOR_DEFAULT),
                                                        (CePoint_t){0, match_point.y + 1});
                         }else if(!draw_color_list->tail || (draw_color_list->tail->fg != CE_COLOR_DEFAULT || draw_color_list->tail->bg != CE_COLOR_DEFAULT)){
                              change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_NORMAL, match_point);
                         }
                    }

                    if(match_len) current_match_len = match_len;
               }else{
                    current_match_len--;
               }

               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 $0x58, %rsp
movq %rdi, 0x20(%rsp)
movq 0x40(%rdi), %rax
testq %rax, %rax
je 0x21376
movq 0x8(%rax), %rbx
testq %rbx, %rbx
jle 0x21376
movq %rcx, %r14
movq %rdx, %r15
movq 0x20(%rsp), %rdx
movq 0x18(%rdx), %rax
movq 0x28(%rdx), %rcx
subq 0x10(%rdx), %rax
addq %rcx, %rax
decq %rbx
cmpq %rbx, %rcx
movq %rbx, %r12
cmovlq %rcx, %r12
xorl %edx, %edx
testq %rcx, %rcx
cmovsq %rdx, %r12
cmpq %rbx, %rax
cmovlq %rax, %rbx
testq %rax, %rax
cmovsq %rdx, %rbx
leaq 0xf(%rsp), %r8
movb $0x0, (%r8)
movq (%rsi), %rdi
movq %rdi, 0x38(%rsp)
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x1fc76
cmpq %rbx, %r12
jg 0x21376
xorl %r13d, %r13d
movq %r15, 0x18(%rsp)
movq %rbx, 0x50(%rsp)
movq %r14, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq (%rax,%r12,8), %rdi
movq %rdi, 0x40(%rsp)
callq 0xe485
movq %rax, 0x30(%rsp)
testb $0x1, %r13b
je 0x20ffc
movq %r15, %rdi
movq %r14, %rsi
movl $0x5, %edx
xorl %ecx, %ecx
movq %r12, %r8
callq 0x2045f
leaq 0x38(%rsp), %rdi
leaq 0xf(%rsp), %rsi
xorl %edx, %edx
movq %r12, %rcx
movq %r15, %r8
movq %r14, %r9
callq 0x1fd0c
cmpb $0x1, 0xf(%rsp)
jne 0x2103a
cmpq $0x0, 0x30(%rsp)
jne 0x2103a
movq %r15, %rdi
movq %r14, %rsi
movl $0xc, %edx
xorl %ecx, %ecx
movq %r12, %r8
callq 0x2045f
movq %r13, 0x28(%rsp)
cmpq $0x0, 0x30(%rsp)
jle 0x21341
leaq 0x1(%r12), %rax
movq %rax, 0x48(%rsp)
movl $0x1, %ebx
xorl %ebp, %ebp
movq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0xe5be
movq %rax, %r13
leaq 0x38(%rsp), %rdi
leaq 0xf(%rsp), %rsi
movq %rbp, %rdx
movq %r12, %rcx
movq %r15, %r8
movq %r14, %r9
callq 0x1fd0c
cmpq $0x1, %rbx
jg 0x210ca
movq 0x28(%rsp), %r14
testb $0x1, %r14b
je 0x210d2
movl $0x2, %edx
leaq 0xfdcd(%rip), %rdi      # 0x30e71
movq %r13, %rsi
callq 0xd0d0
xorl %r15d, %r15d
testl %eax, %eax
sete %r15b
movzbl %r14b, %r14d
cmovel %eax, %r14d
movq %r14, 0x28(%rsp)
addl %r15d, %r15d
jmp 0x21227
decq %rbx
jmp 0x21238
movl $0x7, %ecx
movq %r13, %rdi
movq 0x40(%rsp), %r14
movq %r14, %rsi
leaq 0x1a677(%rip), %rdx     # 0x3b760
callq 0x22476
testq %rax, %rax
je 0x2110a
movq %rax, %r15
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
jmp 0x2121c
movl $0x21, %ecx
movq %r13, %rdi
movq %r14, %rsi
leaq 0x1a684(%rip), %rdx     # 0x3b7a0
callq 0x22476
testq %rax, %rax
je 0x2113d
movq %rax, %r15
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x2, %edx
jmp 0x2121c
movl $0x12, %ecx
movq %r13, %rdi
movq %r14, %rsi
leaq 0x1a761(%rip), %rdx     # 0x3b8b0
callq 0x22476
testq %rax, %rax
je 0x21170
movq %rax, %r15
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x3, %edx
jmp 0x2121c
movq %r13, %rdi
movq %r14, %rsi
callq 0x205bf
testq %rax, %rax
je 0x21197
movq %rax, %r15
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x4, %edx
jmp 0x2121c
movq %r13, %rdi
callq 0x2066f
testq %rax, %rax
je 0x211b8
movq %rax, %r15
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x5, %edx
jmp 0x2121c
movq %r13, %rdi
callq 0x20698
testq %rax, %rax
je 0x211d9
movq %rax, %r15
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x6, %edx
jmp 0x2121c
movq %r13, %rdi
callq 0x206e3
testq %rax, %rax
je 0x211fa
movq %rax, %r15
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x7, %edx
jmp 0x2121c
movq %r13, %rdi
movq %r14, %rsi
callq 0x20721
testq %rax, %rax
je 0x21268
movq %rax, %r15
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x8, %edx
movq %rbp, %rcx
movq %r12, %r8
callq 0x2045f
testq %r15, %r15
cmovneq %r15, %rbx
movq 0x10(%rsp), %r14
movq 0x18(%rsp), %r15
cmpb $0x1, 0xf(%rsp)
jne 0x21255
movq %r15, %rdi
movq %r14, %rsi
movl $0xc, %edx
movq %rbp, %rcx
movq %r12, %r8
callq 0x2045f
incq %rbp
cmpq %rbp, 0x30(%rsp)
jne 0x2105c
jmp 0x21341
movq %r13, %rdi
callq 0x2041d
testq %rax, %rax
je 0x2129b
movq %rax, %r15
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x5, %edx
movq %rbp, %rcx
movq %r12, %r8
callq 0x2045f
movb $0x1, %al
movq %rax, 0x28(%rsp)
jmp 0x21227
movq 0x20(%rsp), %rax
cmpq %r12, 0x38(%rax)
jne 0x212b1
movq 0x20(%rsp), %rax
cmpq 0x30(%rax), %rbp
jle 0x2130e
movq %r13, %rdi
callq 0x204a2
testq %rax, %rax
je 0x2130e
movq %rax, %r15
movq 0x18(%rsp), %r14
movq %r14, %rdi
movq 0x10(%rsp), %r13
movq %r13, %rsi
movl $0xb, %edx
movq %rbp, %rcx
movq %r12, %r8
callq 0x2045f
movl (%r13), %esi
cmpl $-0x2, %esi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovel %eax, %esi
movl 0x4(%r13), %edx
cmpl $-0x2, %edx
cmovel %eax, %edx
movq %r14, %rdi
xorl %ecx, %ecx
movq 0x48(%rsp), %r8
callq 0x1f959
jmp 0x21227
movq 0x18(%rsp), %rdi
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x21327
cmpl $-0x1, (%rax)
jne 0x21327
cmpl $-0x1, 0x4(%rax)
je 0x21339
movq 0x10(%rsp), %rsi
xorl %edx, %edx
movq %rbp, %rcx
movq %r12, %r8
callq 0x2045f
xorl %r15d, %r15d
jmp 0x21227
movq 0x38(%rsp), %rdi
leaq 0xf(%rsp), %rsi
movq %r12, %rdx
movq 0x30(%rsp), %rcx
movq %r15, %r8
callq 0x1fe4e
leaq 0x1(%r12), %rax
movq 0x50(%rsp), %rbx
cmpq %rbx, %r12
movq %rax, %r12
movq 0x28(%rsp), %r13
jne 0x20fc2
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq