// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_ta.c
// Function: refr_cursor_area
static void refr_cursor_area(lv_obj_t * ta)
{
    lv_ta_ext_t * ext = lv_obj_get_ext_attr(ta);

    const lv_style_t * label_style = lv_obj_get_style(ext->label);

    lv_style_t cur_style;
    get_cursor_style(ta, &cur_style);

    uint16_t cur_pos = lv_ta_get_cursor_pos(ta);
    const char * txt = lv_label_get_text(ext->label);

    uint32_t byte_pos;
    byte_pos = lv_txt_encoded_get_byte_id(txt, cur_pos);

    uint32_t letter = lv_txt_encoded_next(&txt[byte_pos], NULL);

    lv_coord_t letter_h = lv_font_get_line_height(label_style->text.font);

    /*Set letter_w (set not 0 on non printable but valid chars)*/
    lv_coord_t letter_w;
    if(letter == '\0' || letter == '\n' || letter == '\r') {
        letter_w = lv_font_get_glyph_width(label_style->text.font, ' ', '\0');
    } else {
        /*`letter_next` parameter is '\0' to ignore kerning*/
        letter_w = lv_font_get_glyph_width(label_style->text.font, letter, '\0');
    }

    lv_point_t letter_pos;
    lv_label_get_letter_pos(ext->label, cur_pos, &letter_pos);

    /*If the cursor is out of the text (most right) draw it to the next line*/
    if(letter_pos.x + ext->label->coords.x1 + letter_w > ext->label->coords.x2 && ext->one_line == 0 &&
       lv_label_get_align(ext->label) != LV_LABEL_ALIGN_RIGHT) {
        letter_pos.x = 0;
        letter_pos.y += letter_h + label_style->text.line_space;

        if(letter != '\0') {
            byte_pos += lv_txt_encoded_size(&txt[byte_pos]);
            letter = lv_txt_encoded_next(&txt[byte_pos], NULL);
        }

        if(letter == '\0' || letter == '\n' || letter == '\r') {
            letter_w = lv_font_get_glyph_width(label_style->text.font, ' ', '\0');
        } else {
            letter_w = lv_font_get_glyph_width(label_style->text.font, letter, '\0');
        }
    }

    /*Save the byte position. It is required to draw `LV_CURSOR_BLOCK`*/
    ext->cursor.txt_byte_pos = byte_pos;

    /*Draw he cursor according to the type*/
    lv_area_t cur_area;

    if(ext->cursor.type == LV_CURSOR_LINE) {
        cur_area.x1 =
            letter_pos.x + cur_style.body.padding.left - (cur_style.line.width >> 1) - (cur_style.line.width & 0x1);
        cur_area.y1 = letter_pos.y + cur_style.body.padding.top;
        cur_area.x2 = letter_pos.x + cur_style.body.padding.right + (cur_style.line.width >> 1);
        cur_area.y2 = letter_pos.y + cur_style.body.padding.bottom + letter_h;
    } else if(ext->cursor.type == LV_CURSOR_BLOCK) {
        cur_area.x1 = letter_pos.x - cur_style.body.padding.left;
        cur_area.y1 = letter_pos.y - cur_style.body.padding.top;
        cur_area.x2 = letter_pos.x + cur_style.body.padding.right + letter_w;
        cur_area.y2 = letter_pos.y + cur_style.body.padding.bottom + letter_h;

    } else if(ext->cursor.type == LV_CURSOR_OUTLINE) {
        cur_area.x1 = letter_pos.x - cur_style.body.padding.left;
        cur_area.y1 = letter_pos.y - cur_style.body.padding.top;
        cur_area.x2 = letter_pos.x + cur_style.body.padding.right + letter_w;
        cur_area.y2 = letter_pos.y + cur_style.body.padding.bottom + letter_h;
    } else if(ext->cursor.type == LV_CURSOR_UNDERLINE) {
        cur_area.x1 = letter_pos.x + cur_style.body.padding.left;
        cur_area.y1 = letter_pos.y + cur_style.body.padding.top + letter_h - (cur_style.line.width >> 1);
        cur_area.x2 = letter_pos.x + cur_style.body.padding.right + letter_w;
        cur_area.y2 = letter_pos.y + cur_style.body.padding.bottom + letter_h + (cur_style.line.width >> 1) +
                      (cur_style.line.width & 0x1);
    }

    /*Save the new area*/
    lv_disp_t * disp = lv_obj_get_disp(ta);
    lv_area_t area_tmp;
    lv_area_copy(&area_tmp, &ext->cursor.area);
    area_tmp.x1 += ext->label->coords.x1;
    area_tmp.y1 += ext->label->coords.y1;
    area_tmp.x2 += ext->label->coords.x1;
    area_tmp.y2 += ext->label->coords.y1;
    lv_inv_area(disp, &area_tmp);

    lv_area_copy(&ext->cursor.area, &cur_area);

    lv_area_copy(&area_tmp, &ext->cursor.area);
    area_tmp.x1 += ext->label->coords.x1;
    area_tmp.y1 += ext->label->coords.y1;
    area_tmp.x2 += ext->label->coords.x1;
    area_tmp.y2 += ext->label->coords.y1;
    lv_inv_area(disp, &area_tmp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0xa080
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x34710
movq -0x8(%rbp), %rdi
callq 0x32ab0
movw %ax, -0x62(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x2abc0
movq %rax, -0x70(%rbp)
leaq 0x491d1(%rip), %rax     # 0x7c6d0
movq (%rax), %rax
movq -0x70(%rbp), %rdi
movzwl -0x62(%rbp), %esi
callq *%rax
movl %eax, -0x74(%rbp)
leaq 0x491aa(%rip), %rax     # 0x7c6c0
movq (%rax), %rax
movq -0x70(%rbp), %rdi
movl -0x74(%rbp), %ecx
addq %rcx, %rdi
xorl %ecx, %ecx
movl %ecx, %esi
callq *%rax
movl %eax, -0x78(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x33480
movzbl %al, %eax
movw %ax, -0x7a(%rbp)
cmpl $0x0, -0x78(%rbp)
je 0x33552
cmpl $0xa, -0x78(%rbp)
je 0x33552
cmpl $0xd, -0x78(%rbp)
jne 0x3356c
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
movl $0x20, %esi
xorl %edx, %edx
callq 0x415e0
movw %ax, -0x7c(%rbp)
jmp 0x33582
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
movl -0x78(%rbp), %esi
xorl %edx, %edx
callq 0x415e0
movw %ax, -0x7c(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
leaq -0x80(%rbp), %rdx
movzwl -0x62(%rbp), %esi
callq 0x2bca0
movswl -0x80(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x50(%rcx), %rcx
movswl 0x20(%rcx), %ecx
addl %ecx, %eax
movswl -0x7c(%rbp), %ecx
addl %ecx, %eax
movq -0x10(%rbp), %rcx
movq 0x50(%rcx), %rcx
movswl 0x24(%rcx), %ecx
cmpl %ecx, %eax
jle 0x3369a
movq -0x10(%rbp), %rax
movb 0x98(%rax), %al
shrb %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x3369a
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x2ab50
movzbl %al, %eax
cmpl $0x2, %eax
je 0x3369a
movw $0x0, -0x80(%rbp)
movswl -0x7a(%rbp), %ecx
movq -0x18(%rbp), %rax
movswl 0x32(%rax), %eax
addl %eax, %ecx
movswl -0x7e(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x7e(%rbp)
cmpl $0x0, -0x78(%rbp)
je 0x33656
leaq 0x49087(%rip), %rax     # 0x7c6a8
movq (%rax), %rax
movq -0x70(%rbp), %rdi
movl -0x74(%rbp), %ecx
addq %rcx, %rdi
callq *%rax
movzbl %al, %eax
addl -0x74(%rbp), %eax
movl %eax, -0x74(%rbp)
leaq 0x49080(%rip), %rax     # 0x7c6c0
movq (%rax), %rax
movq -0x70(%rbp), %rdi
movl -0x74(%rbp), %ecx
addq %rcx, %rdi
xorl %ecx, %ecx
movl %ecx, %esi
callq *%rax
movl %eax, -0x78(%rbp)
cmpl $0x0, -0x78(%rbp)
je 0x33668
cmpl $0xa, -0x78(%rbp)
je 0x33668
cmpl $0xd, -0x78(%rbp)
jne 0x33682
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
movl $0x20, %esi
xorl %edx, %edx
callq 0x415e0
movw %ax, -0x7c(%rbp)
jmp 0x33698
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
movl -0x78(%rbp), %esi
xorl %edx, %edx
callq 0x415e0
movw %ax, -0x7c(%rbp)
jmp 0x3369a
movl -0x74(%rbp), %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x8e(%rax)
movq -0x10(%rbp), %rax
movb 0x90(%rax), %al
andb $0xf, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x33727
movswl -0x80(%rbp), %eax
movswl -0x46(%rbp), %ecx
addl %ecx, %eax
movswl -0x22(%rbp), %ecx
sarl %ecx
subl %ecx, %eax
movswl -0x22(%rbp), %ecx
andl $0x1, %ecx
subl %ecx, %eax
movw %ax, -0x88(%rbp)
movswl -0x7e(%rbp), %eax
movswl -0x4a(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x86(%rbp)
movswl -0x80(%rbp), %eax
movswl -0x44(%rbp), %ecx
addl %ecx, %eax
movswl -0x22(%rbp), %ecx
sarl %ecx
addl %ecx, %eax
movw %ax, -0x84(%rbp)
movswl -0x7e(%rbp), %eax
movswl -0x48(%rbp), %ecx
addl %ecx, %eax
movswl -0x7a(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x82(%rbp)
jmp 0x33882
movq -0x10(%rbp), %rax
movb 0x90(%rax), %al
andb $0xf, %al
movzbl %al, %eax
cmpl $0x2, %eax
jne 0x33790
movswl -0x80(%rbp), %eax
movswl -0x46(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x88(%rbp)
movswl -0x7e(%rbp), %eax
movswl -0x4a(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x86(%rbp)
movswl -0x80(%rbp), %eax
movswl -0x44(%rbp), %ecx
addl %ecx, %eax
movswl -0x7c(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x84(%rbp)
movswl -0x7e(%rbp), %eax
movswl -0x48(%rbp), %ecx
addl %ecx, %eax
movswl -0x7a(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x82(%rbp)
jmp 0x33880
movq -0x10(%rbp), %rax
movb 0x90(%rax), %al
andb $0xf, %al
movzbl %al, %eax
cmpl $0x3, %eax
jne 0x337f9
movswl -0x80(%rbp), %eax
movswl -0x46(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x88(%rbp)
movswl -0x7e(%rbp), %eax
movswl -0x4a(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x86(%rbp)
movswl -0x80(%rbp), %eax
movswl -0x44(%rbp), %ecx
addl %ecx, %eax
movswl -0x7c(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x84(%rbp)
movswl -0x7e(%rbp), %eax
movswl -0x48(%rbp), %ecx
addl %ecx, %eax
movswl -0x7a(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x82(%rbp)
jmp 0x3387e
movq -0x10(%rbp), %rax
movb 0x90(%rax), %al
andb $0xf, %al
movzbl %al, %eax
cmpl $0x4, %eax
jne 0x3387c
movswl -0x80(%rbp), %eax
movswl -0x46(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x88(%rbp)
movswl -0x7e(%rbp), %eax
movswl -0x4a(%rbp), %ecx
addl %ecx, %eax
movswl -0x7a(%rbp), %ecx
addl %ecx, %eax
movswl -0x22(%rbp), %ecx
sarl %ecx
subl %ecx, %eax
movw %ax, -0x86(%rbp)
movswl -0x80(%rbp), %eax
movswl -0x44(%rbp), %ecx
addl %ecx, %eax
movswl -0x7c(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x84(%rbp)
movswl -0x7e(%rbp), %eax
movswl -0x48(%rbp), %ecx
addl %ecx, %eax
movswl -0x7a(%rbp), %ecx
addl %ecx, %eax
movswl -0x22(%rbp), %ecx
sarl %ecx
addl %ecx, %eax
movswl -0x22(%rbp), %ecx
andl $0x1, %ecx
addl %ecx, %eax
movw %ax, -0x82(%rbp)
jmp 0x3387e
jmp 0x33880
jmp 0x33882
movq -0x8(%rbp), %rdi
callq 0x7a40
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rsi
addq $0x78, %rsi
addq $0xe, %rsi
leaq -0x98(%rbp), %rdi
callq 0x34820
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movswl 0x20(%rax), %ecx
movswl -0x98(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x98(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movswl 0x22(%rax), %ecx
movswl -0x96(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x96(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movswl 0x20(%rax), %ecx
movswl -0x94(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x94(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movswl 0x22(%rax), %ecx
movswl -0x92(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x92(%rbp)
movq -0x90(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xadd0
movq -0x10(%rbp), %rdi
addq $0x78, %rdi
addq $0xe, %rdi
leaq -0x88(%rbp), %rsi
callq 0x34820
movq -0x10(%rbp), %rsi
addq $0x78, %rsi
addq $0xe, %rsi
leaq -0x98(%rbp), %rdi
callq 0x34820
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movswl 0x20(%rax), %ecx
movswl -0x98(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x98(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movswl 0x22(%rax), %ecx
movswl -0x96(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x96(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movswl 0x20(%rax), %ecx
movswl -0x94(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x94(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movswl 0x22(%rax), %ecx
movswl -0x92(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x92(%rbp)
movq -0x90(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xadd0
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)