// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_ta.c
// Function: lv_ta_scrollable_design
static bool lv_ta_scrollable_design(lv_obj_t * scrl, const lv_area_t * mask, lv_design_mode_t mode)
{
    if(mode == LV_DESIGN_COVER_CHK) {
        /*Return false if the object is not covers the mask_p area*/
        return scrl_design(scrl, mask, mode);
    } else if(mode == LV_DESIGN_DRAW_MAIN) {
        /*Draw the object*/
        scrl_design(scrl, mask, mode);
    } else if(mode == LV_DESIGN_DRAW_POST) {
        scrl_design(scrl, mask, mode);

        /*Draw the cursor*/
        lv_obj_t * ta     = lv_obj_get_parent(scrl);
        lv_ta_ext_t * ext = lv_obj_get_ext_attr(ta);

        if(ext->cursor.type == LV_CURSOR_NONE || (ext->cursor.type & LV_CURSOR_HIDDEN) || ext->cursor.state == 0) {
            return true; /*The cursor is not visible now*/
        }

        lv_style_t cur_style;
        get_cursor_style(ta, &cur_style);

        const char * txt = lv_label_get_text(ext->label);

        /*Draw he cursor according to the type*/
        lv_area_t cur_area;
        lv_area_copy(&cur_area, &ext->cursor.area);

        cur_area.x1 += ext->label->coords.x1;
        cur_area.y1 += ext->label->coords.y1;
        cur_area.x2 += ext->label->coords.x1;
        cur_area.y2 += ext->label->coords.y1;

        lv_opa_t opa_scale = lv_obj_get_opa_scale(ta);

        if(ext->cursor.type == LV_CURSOR_LINE) {
            lv_draw_rect(&cur_area, mask, &cur_style, opa_scale);
        } else if(ext->cursor.type == LV_CURSOR_BLOCK) {
            lv_draw_rect(&cur_area, mask, &cur_style, opa_scale);

            char letter_buf[8] = {0};
            memcpy(letter_buf, &txt[ext->cursor.txt_byte_pos], lv_txt_encoded_size(&txt[ext->cursor.txt_byte_pos]));

            cur_area.x1 += cur_style.body.padding.left;
            cur_area.y1 += cur_style.body.padding.top;
            lv_draw_label(&cur_area, mask, &cur_style, opa_scale, letter_buf, LV_TXT_FLAG_NONE, NULL, NULL, NULL, lv_obj_get_base_dir(ta));

        } else if(ext->cursor.type == LV_CURSOR_OUTLINE) {
            cur_style.body.opa = LV_OPA_TRANSP;
            if(cur_style.body.border.width == 0) cur_style.body.border.width = 1; /*Be sure the border will be drawn*/
            lv_draw_rect(&cur_area, mask, &cur_style, opa_scale);
        } else if(ext->cursor.type == LV_CURSOR_UNDERLINE) {
            lv_draw_rect(&cur_area, mask, &cur_style, opa_scale);
        }
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
cmpl $0x2, %eax
jne 0x31610
movq 0x57ed8(%rip), %rax     # 0x894d0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movzbl -0x19(%rbp), %edx
callq *%rax
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x3196f
movzbl -0x19(%rbp), %eax
cmpl $0x0, %eax
jne 0x31633
movq 0x57eb0(%rip), %rax     # 0x894d0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movzbl -0x19(%rbp), %edx
callq *%rax
jmp 0x31969
movzbl -0x19(%rbp), %eax
cmpl $0x1, %eax
jne 0x31967
movq 0x57e89(%rip), %rax     # 0x894d0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movzbl -0x19(%rbp), %edx
callq *%rax
movq -0x10(%rbp), %rdi
callq 0x71b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movb 0x90(%rax), %al
andb $0xf, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x316b1
movq -0x30(%rbp), %rax
movb 0x90(%rax), %al
andb $0xf, %al
movzbl %al, %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x316b1
movq -0x30(%rbp), %rax
movb 0x90(%rax), %al
shrb $0x4, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x316ba
movb $0x1, -0x1(%rbp)
jmp 0x3196f
movq -0x28(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x34710
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x2abc0
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rsi
addq $0x78, %rsi
addq $0xe, %rsi
leaq -0x88(%rbp), %rdi
callq 0x34820
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rax
movswl 0x20(%rax), %ecx
movswl -0x88(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x88(%rbp)
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rax
movswl 0x22(%rax), %ecx
movswl -0x86(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x86(%rbp)
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rax
movswl 0x20(%rax), %ecx
movswl -0x84(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x84(%rbp)
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rax
movswl 0x22(%rax), %ecx
movswl -0x82(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x82(%rbp)
movq -0x28(%rbp), %rdi
callq 0xa710
movb %al, -0x89(%rbp)
movq -0x30(%rbp), %rax
movb 0x90(%rax), %al
andb $0xf, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x317a3
movq -0x18(%rbp), %rsi
leaq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rdx
movzbl -0x89(%rbp), %ecx
callq 0x5a9e0
jmp 0x31965
movq -0x30(%rbp), %rax
movb 0x90(%rax), %al
andb $0xf, %al
movzbl %al, %eax
cmpl $0x2, %eax
jne 0x318ec
movq -0x18(%rbp), %rsi
leaq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rdx
movzbl -0x89(%rbp), %ecx
callq 0x5a9e0
leaq -0x91(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x2090
leaq -0x91(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x80(%rbp), %rax
movq -0x30(%rbp), %rcx
movzwl 0x8e(%rcx), %ecx
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
leaq 0x4ae91(%rip), %rax     # 0x7c6a8
movq (%rax), %rax
movq -0x80(%rbp), %rdi
movq -0x30(%rbp), %rcx
movzwl 0x8e(%rcx), %ecx
addq %rcx, %rdi
callq *%rax
movq -0xc0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
movzbl %al, %eax
movl %eax, %edx
callq 0x20e0
movswl -0x5e(%rbp), %ecx
movswl -0x88(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x88(%rbp)
movswl -0x62(%rbp), %ecx
movswl -0x86(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x86(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xb0(%rbp)
movb -0x89(%rbp), %al
movb %al, -0xa1(%rbp)
leaq -0x91(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x28(%rbp), %rdi
callq 0x7180
movq -0xb0(%rbp), %rsi
movb -0xa1(%rbp), %cl
movq -0xa0(%rbp), %r8
leaq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rdx
xorl %r9d, %r9d
xorl %r10d, %r10d
movzbl %cl, %ecx
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movzbl %al, %eax
movl %eax, 0x18(%rsp)
callq 0x5f210
jmp 0x31963
movq -0x30(%rbp), %rax
movb 0x90(%rax), %al
andb $0xf, %al
movzbl %al, %eax
cmpl $0x3, %eax
jne 0x31930
movb $0x0, -0x70(%rbp)
movswl -0x6c(%rbp), %eax
cmpl $0x0, %eax
jne 0x31913
movw $0x1, -0x6c(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rdx
movzbl -0x89(%rbp), %ecx
callq 0x5a9e0
jmp 0x31961
movq -0x30(%rbp), %rax
movb 0x90(%rax), %al
andb $0xf, %al
movzbl %al, %eax
cmpl $0x4, %eax
jne 0x3195f
movq -0x18(%rbp), %rsi
leaq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rdx
movzbl -0x89(%rbp), %ecx
callq 0x5a9e0
jmp 0x31961
jmp 0x31963
jmp 0x31965
jmp 0x31967
jmp 0x31969
jmp 0x3196b
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax)