// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_label.c
// Function: lv_label_is_char_under_pos
bool lv_label_is_char_under_pos(const lv_obj_t * label, lv_point_t * pos)
{
    LV_ASSERT_OBJ(label, LV_OBJX_NAME);
    LV_ASSERT_NULL(pos);

    const char * txt         = lv_label_get_text(label);
    lv_label_ext_t * ext     = lv_obj_get_ext_attr(label);
    uint32_t line_start      = 0;
    uint32_t new_line_start  = 0;
    lv_coord_t max_w         = lv_obj_get_width(label);
    const lv_style_t * style = lv_obj_get_style(label);
    const lv_font_t * font   = style->text.font;
    uint8_t letter_height    = lv_font_get_line_height(font);
    lv_coord_t y             = 0;
    lv_txt_flag_t flag       = LV_TXT_FLAG_NONE;
    lv_label_align_t align = lv_label_get_align(label);

    if(ext->recolor != 0) flag |= LV_TXT_FLAG_RECOLOR;
    if(ext->expand != 0) flag |= LV_TXT_FLAG_EXPAND;
    if(align == LV_LABEL_ALIGN_CENTER) flag |= LV_TXT_FLAG_CENTER;

    /*If the width will be expanded set the max length to very big */
    if(ext->long_mode == LV_LABEL_LONG_EXPAND) {
        max_w = LV_COORD_MAX;
    }

    /*Search the line of the index letter */;
    while(txt[line_start] != '\0') {
        new_line_start += lv_txt_get_next_line(&txt[line_start], font, style->text.letter_space, max_w, flag);

        if(pos->y <= y + letter_height) break; /*The line is found (stored in 'line_start')*/
        y += letter_height + style->text.line_space;

        line_start = new_line_start;
    }

    /*Calculate the x coordinate*/
    lv_coord_t x      = 0;
    lv_coord_t last_x = 0;
    if(align == LV_LABEL_ALIGN_CENTER) {
        lv_coord_t line_w;
        line_w = lv_txt_get_width(&txt[line_start], new_line_start - line_start, font, style->text.letter_space, flag);
        x += lv_obj_get_width(label) / 2 - line_w / 2;
    }
    else if(align == LV_LABEL_ALIGN_RIGHT) {
        lv_coord_t line_w;
        line_w = lv_txt_get_width(&txt[line_start], new_line_start - line_start, font, style->text.letter_space, flag);
        x += lv_obj_get_width(label) - line_w;
    }

    lv_txt_cmd_state_t cmd_state = LV_TXT_CMD_STATE_WAIT;

    uint32_t i           = line_start;
    uint32_t i_current   = i;
    uint32_t letter      = '\0';
    uint32_t letter_next = '\0';

    if(new_line_start > 0) {
        while(i <= new_line_start - 1) {
            /* Get the current letter
             * Be careful 'i' already points to the next character */
            letter = lv_txt_encoded_next(txt, &i);

            /*Get the next letter for kerning*/
            letter_next = lv_txt_encoded_next(&txt[i], NULL);

            /*Handle the recolor command*/
            if((flag & LV_TXT_FLAG_RECOLOR) != 0) {
                if(lv_txt_is_cmd(&cmd_state, txt[i]) != false) {
                    continue; /*Skip the letter is it is part of a command*/
                }
            }
            last_x = x;
            x += lv_font_get_glyph_width(font, letter, letter_next);
            if(pos->x < x) {
                i = i_current;
                break;
            }
            x += style->text.letter_space;
            i_current = i;
        }
    }

    int32_t max_diff = lv_font_get_glyph_width(font, letter, letter_next) + style->text.letter_space + 1;
    return (pos->x >= (last_x - style->text.letter_space) && pos->x <= (last_x + max_diff));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x2c4ef
movq -0x8(%rbp), %rsi
leaq 0x3bc14(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x2c4ed
movq -0x10(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x2c50e
movq -0x10(%rbp), %rsi
leaq 0x3bbf5(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x2c50c
movq -0x8(%rbp), %rdi
callq 0x2abc0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
movw %ax, -0x2a(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa080
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x2c020
movb %al, -0x41(%rbp)
movw $0x0, -0x44(%rbp)
movb $0x0, -0x45(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2ab50
movb %al, -0x46(%rbp)
movq -0x20(%rbp), %rax
movw 0x18(%rax), %ax
shrw $0x6, %ax
andw $0x1, %ax
movzbl %al, %eax
cmpl $0x0, %eax
je 0x2c5a0
movzbl -0x45(%rbp), %eax
orl $0x1, %eax
movb %al, -0x45(%rbp)
movq -0x20(%rbp), %rax
movw 0x18(%rax), %ax
shrw $0x7, %ax
andw $0x1, %ax
movzbl %al, %eax
cmpl $0x0, %eax
je 0x2c5c2
movzbl -0x45(%rbp), %eax
orl $0x2, %eax
movb %al, -0x45(%rbp)
movzbl -0x46(%rbp), %eax
cmpl $0x1, %eax
jne 0x2c5d5
movzbl -0x45(%rbp), %eax
orl $0x4, %eax
movb %al, -0x45(%rbp)
movq -0x20(%rbp), %rax
movw 0x18(%rax), %ax
andw $0x7, %ax
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x2c5ef
movw $0x7c18, -0x2a(%rbp)    # imm = 0x7C18
jmp 0x2c5f1
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x2c66c
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %eax
addq %rax, %rdi
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rax
movw 0x30(%rax), %cx
movw -0x2a(%rbp), %ax
movswl %cx, %edx
movswl %ax, %ecx
movzbl -0x45(%rbp), %r8d
callq 0x46a40
movzwl %ax, %eax
addl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movswl 0x2(%rax), %eax
movswl -0x44(%rbp), %ecx
movzbl -0x41(%rbp), %edx
addl %edx, %ecx
cmpl %ecx, %eax
jg 0x2c64c
jmp 0x2c66c
movzbl -0x41(%rbp), %ecx
movq -0x38(%rbp), %rax
movswl 0x32(%rax), %eax
addl %eax, %ecx
movswl -0x44(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x44(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x2c5f1
movw $0x0, -0x48(%rbp)
movw $0x0, -0x4a(%rbp)
movzbl -0x46(%rbp), %eax
cmpl $0x1, %eax
jne 0x2c6e2
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %eax
addq %rax, %rdi
movl -0x28(%rbp), %eax
subl -0x24(%rbp), %eax
movw %ax, %cx
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rax
movw 0x30(%rax), %ax
movzwl %cx, %esi
movswl %ax, %ecx
movzbl -0x45(%rbp), %r8d
callq 0x46bd0
movw %ax, -0x4c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movswl -0x4c(%rbp), %eax
movl $0x2, %esi
cltd
idivl %esi
subl %eax, %ecx
movswl -0x48(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x48(%rbp)
jmp 0x2c73c
movzbl -0x46(%rbp), %eax
cmpl $0x2, %eax
jne 0x2c73a
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %eax
addq %rax, %rdi
movl -0x28(%rbp), %eax
subl -0x24(%rbp), %eax
movw %ax, %cx
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rax
movw 0x30(%rax), %ax
movzwl %cx, %esi
movswl %ax, %ecx
movzbl -0x45(%rbp), %r8d
callq 0x46bd0
movw %ax, -0x4e(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
movswl %ax, %ecx
movswl -0x4e(%rbp), %eax
subl %eax, %ecx
movswl -0x48(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x48(%rbp)
jmp 0x2c73c
movb $0x0, -0x4f(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x60(%rbp)
cmpl $0x0, -0x28(%rbp)
jbe 0x2c833
jmp 0x2c766
movl -0x54(%rbp), %eax
movl -0x28(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x2c831
leaq 0x4ff42(%rip), %rax     # 0x7c6c0
movq (%rax), %rax
movq -0x18(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq *%rax
movl %eax, -0x5c(%rbp)
leaq 0x4ff2b(%rip), %rax     # 0x7c6c0
movq (%rax), %rax
movq -0x18(%rbp), %rdi
movl -0x54(%rbp), %ecx
addq %rcx, %rdi
xorl %ecx, %ecx
movl %ecx, %esi
callq *%rax
movl %eax, -0x60(%rbp)
movzbl -0x45(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2c7d9
movq -0x18(%rbp), %rax
movl -0x54(%rbp), %ecx
movsbl (%rax,%rcx), %esi
leaq -0x4f(%rbp), %rdi
callq 0x46ff0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x2c7d7
jmp 0x2c766
jmp 0x2c7d9
movw -0x48(%rbp), %ax
movw %ax, -0x4a(%rbp)
movq -0x40(%rbp), %rdi
movl -0x5c(%rbp), %esi
movl -0x60(%rbp), %edx
callq 0x415e0
movzwl %ax, %ecx
movswl -0x48(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movswl (%rax), %eax
movswl -0x48(%rbp), %ecx
cmpl %ecx, %eax
jge 0x2c814
movl -0x58(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x2c831
movq -0x38(%rbp), %rax
movswl 0x30(%rax), %ecx
movswl -0x48(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x48(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0x58(%rbp)
jmp 0x2c766
jmp 0x2c833
movq -0x40(%rbp), %rdi
movl -0x5c(%rbp), %esi
movl -0x60(%rbp), %edx
callq 0x415e0
movzwl %ax, %eax
movq -0x38(%rbp), %rcx
movswl 0x30(%rcx), %ecx
addl %ecx, %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movq -0x10(%rbp), %rax
movswl (%rax), %ecx
movswl -0x4a(%rbp), %edx
movq -0x38(%rbp), %rax
movswl 0x30(%rax), %eax
subl %eax, %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x65(%rbp)
jl 0x2c889
movq -0x10(%rbp), %rax
movswl (%rax), %eax
movswl -0x4a(%rbp), %ecx
addl -0x64(%rbp), %ecx
cmpl %ecx, %eax
setle %al
movb %al, -0x65(%rbp)
movb -0x65(%rbp), %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)