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

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

          if(*line == '+'){
               change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_DIFF_ADD, match_point);
               current_match_len = line_len + 1;
          }else if(*line == '-'){
               change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_DIFF_REMOVE, match_point);
               current_match_len = line_len + 1;
          }else if(*line == '#'){
               change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_DIFF_COMMENT, match_point);
               current_match_len = line_len + 1;
          }else if(strncmp(line, "@@", 2) == 0){
               char* end = strstr(line + 2, "@@");
               if(end){
                    change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_DIFF_HEADER, match_point);
                    current_match_len = ce_utf8_strlen_between(line, end + 2);
               }
          }else{
               change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_NORMAL, match_point);
          }

          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){
               match_point.x = x;

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

               if(current_match_len <= 1){
                    change_draw_color(draw_color_list, syntax_defs, CE_SYNTAX_COLOR_NORMAL, match_point);
               }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
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x40(%rax)
jne 0x2f43f
jmp 0x2f7fd
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
cmpq $0x0, 0x8(%rax)
jg 0x2f453
jmp 0x2f7fd
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x8(%rbp), %rdx
subq 0x10(%rdx), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
subq $0x1, %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jge 0x2f49d
movq $0x0, -0x40(%rbp)
cmpq $0x0, -0x30(%rbp)
jge 0x2f4af
xorl %eax, %eax
movq %rax, -0x98(%rbp)
jmp 0x2f4df
movq -0x30(%rbp), %rax
cmpq -0x40(%rbp), %rax
jle 0x2f4c6
movq -0x40(%rbp), %rax
movq %rax, -0xa0(%rbp)
jmp 0x2f4d1
movq -0x30(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x38(%rbp)
jge 0x2f4fc
xorl %eax, %eax
movq %rax, -0xa8(%rbp)
jmp 0x2f52c
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jle 0x2f513
movq -0x40(%rbp), %rax
movq %rax, -0xb0(%rbp)
jmp 0x2f51e
movq -0x38(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x38(%rbp)
movb $0x0, -0x41(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x41(%rbp), %r8
callq 0x2b7f0
movq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x38(%rbp), %rax
jg 0x2f7fd
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
callq 0xea70
movq %rax, -0x68(%rbp)
movq $0x1, -0x70(%rbp)
movq $0x0, -0x80(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %r8
movq -0x20(%rbp), %r9
movq -0x80(%rbp), %rdx
movq -0x78(%rbp), %rcx
leaq -0x50(%rbp), %rdi
leaq -0x41(%rbp), %rsi
callq 0x2b8e0
movq -0x60(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x2f605
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x80(%rbp), %rcx
movq -0x78(%rbp), %r8
movl $0xe, %edx
callq 0x2c4f0
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x2f703
movq -0x60(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x2f63c
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x80(%rbp), %rcx
movq -0x78(%rbp), %r8
movl $0xf, %edx
callq 0x2c4f0
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x2f701
movq -0x60(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x2f673
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x80(%rbp), %rcx
movq -0x78(%rbp), %r8
movl $0x11, %edx
callq 0x2c4f0
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x2f6ff
movq -0x60(%rbp), %rdi
leaq 0x157e4(%rip), %rsi     # 0x44e62
movl $0x2, %edx
callq 0xd0d0
cmpl $0x0, %eax
jne 0x2f6e6
movq -0x60(%rbp), %rdi
addq $0x2, %rdi
leaq 0x157c6(%rip), %rsi     # 0x44e62
callq 0xd6d0
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x2f6e4
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x80(%rbp), %rcx
movq -0x78(%rbp), %r8
movl $0x10, %edx
callq 0x2c4f0
movq -0x60(%rbp), %rdi
movq -0x88(%rbp), %rsi
addq $0x2, %rsi
callq 0x11a20
movq %rax, -0x70(%rbp)
jmp 0x2f6fd
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x80(%rbp), %rcx
movq -0x78(%rbp), %r8
xorl %edx, %edx
callq 0x2c4f0
jmp 0x2f6ff
jmp 0x2f701
jmp 0x2f703
testb $0x1, -0x41(%rbp)
je 0x2f72a
cmpq $0x0, -0x68(%rbp)
jne 0x2f72a
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x80(%rbp), %rcx
movq -0x78(%rbp), %r8
movl $0xc, %edx
callq 0x2c4f0
movq $0x0, -0x90(%rbp)
movq -0x90(%rbp), %rax
cmpq -0x68(%rbp), %rax
jge 0x2f7d3
movq -0x90(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %r8
movq -0x20(%rbp), %r9
movq -0x80(%rbp), %rdx
movq -0x78(%rbp), %rcx
leaq -0x50(%rbp), %rdi
leaq -0x41(%rbp), %rsi
callq 0x2b8e0
cmpq $0x1, -0x70(%rbp)
jg 0x2f78e
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x80(%rbp), %rcx
movq -0x78(%rbp), %r8
xorl %edx, %edx
callq 0x2c4f0
jmp 0x2f79a
movq -0x70(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x70(%rbp)
testb $0x1, -0x41(%rbp)
je 0x2f7ba
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x80(%rbp), %rcx
movq -0x78(%rbp), %r8
movl $0xc, %edx
callq 0x2c4f0
jmp 0x2f7bc
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x2f735
movq -0x50(%rbp), %rdi
movq -0x78(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x18(%rbp), %r8
leaq -0x41(%rbp), %rsi
callq 0x2ba90
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x2f567
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)