// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_page.c
// Function: lv_page_design
static bool lv_page_design(lv_obj_t * page, const lv_area_t * mask, lv_design_mode_t mode)
{
    if(mode == LV_DESIGN_COVER_CHK) {
        return ancestor_design(page, mask, mode);
    }
    /*Cache page bg style for temporary modification*/
    const lv_style_t * style = lv_page_get_style(page, LV_PAGE_STYLE_BG);
    lv_style_t style_tmp;
    lv_style_copy(&style_tmp, style);

    if(mode == LV_DESIGN_DRAW_MAIN) {
        /*Draw without border*/
        style_tmp.body.border.width = 0;
        lv_draw_rect(&page->coords, mask, &style_tmp, lv_obj_get_opa_scale(page));

    } else if(mode == LV_DESIGN_DRAW_POST) {
        /*Draw only a border*/
        style_tmp.body.shadow.width = 0;
        style_tmp.body.opa          = LV_OPA_TRANSP;
        lv_draw_rect(&page->coords, mask, &style_tmp, lv_obj_get_opa_scale(page));

        lv_page_ext_t * ext = lv_obj_get_ext_attr(page);

        /*Draw the scrollbars*/
        lv_area_t sb_area;
        if(ext->sb.hor_draw && (ext->sb.mode & LV_SB_MODE_HIDE) == 0) {
            /*Convert the relative coordinates to absolute*/
            lv_area_copy(&sb_area, &ext->sb.hor_area);
            sb_area.x1 += page->coords.x1;
            sb_area.y1 += page->coords.y1;
            sb_area.x2 += page->coords.x1;
            sb_area.y2 += page->coords.y1;
            lv_draw_rect(&sb_area, mask, ext->sb.style, lv_obj_get_opa_scale(page));
        }

        if(ext->sb.ver_draw && (ext->sb.mode & LV_SB_MODE_HIDE) == 0) {
            /*Convert the relative coordinates to absolute*/
            lv_area_copy(&sb_area, &ext->sb.ver_area);
            sb_area.x1 += page->coords.x1;
            sb_area.y1 += page->coords.y1;
            sb_area.x2 += page->coords.x1;
            sb_area.y2 += page->coords.y1;
            lv_draw_rect(&sb_area, mask, ext->sb.style, lv_obj_get_opa_scale(page));
        }

#if LV_USE_ANIMATION
        {
            lv_coord_t page_w = lv_obj_get_width(page);
            lv_coord_t page_h = lv_obj_get_height(page);

            lv_area_t flash_area;

            if(ext->edge_flash.top_ip) {
                flash_area.x1 = page->coords.x1 - page_w;
                flash_area.x2 = page->coords.x2 + page_w;
                flash_area.y1 = page->coords.y1 - 3 * page_w + ext->edge_flash.state;
                flash_area.y2 = page->coords.y1 + ext->edge_flash.state;
            } else if(ext->edge_flash.bottom_ip) {
                flash_area.x1 = page->coords.x1 - page_w;
                flash_area.x2 = page->coords.x2 + page_w;
                flash_area.y1 = page->coords.y2 - ext->edge_flash.state;
                flash_area.y2 = page->coords.y2 + 3 * page_w - ext->edge_flash.state;
            } else if(ext->edge_flash.right_ip) {
                flash_area.x1 = page->coords.x2 - ext->edge_flash.state;
                flash_area.x2 = page->coords.x2 + 3 * page_h - ext->edge_flash.state;
                flash_area.y1 = page->coords.y1 - page_h;
                flash_area.y2 = page->coords.y2 + page_h;
            } else if(ext->edge_flash.left_ip) {
                flash_area.x1 = page->coords.x1 - 3 * page_h + ext->edge_flash.state;
                flash_area.x2 = page->coords.x1 + ext->edge_flash.state;
                flash_area.y1 = page->coords.y1 - page_h;
                flash_area.y2 = page->coords.y2 + page_h;
            }

            if(ext->edge_flash.left_ip || ext->edge_flash.right_ip || ext->edge_flash.top_ip ||
               ext->edge_flash.bottom_ip) {
                lv_style_t flash_style;
                lv_style_copy(&flash_style, ext->edge_flash.style);
                flash_style.body.radius = LV_RADIUS_CIRCLE;
                uint32_t opa            = (flash_style.body.opa * ext->edge_flash.state) / LV_PAGE_END_FLASH_SIZE;
                flash_style.body.opa    = opa;
                lv_draw_rect(&flash_area, mask, &flash_style, lv_obj_get_opa_scale(page));
            }
        }
#endif
    }

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x2, %edx
jne 0x23d81
movq 0x3a70b(%rip), %rax     # 0x5e470
pushq $0x2
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movl %edx, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x24149
leaq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x74d4
cmpb $0x1, %bpl
je 0x23dd4
movzbl %bpl, %eax
testl %eax, %eax
jne 0x23fd9
leaq 0x18(%rsp), %r15
andw $0x0, 0xc(%r15)
leaq 0x20(%r14), %r12
movq %r14, %rdi
callq 0x6649
movzbl %al, %ecx
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
jmp 0x23fd4
leaq 0x18(%rsp), %r15
andw $0x0, 0x12(%r15)
movb $0x0, 0x8(%r15)
leaq 0x20(%r14), %r12
movq %r14, %rdi
callq 0x6649
movzbl %al, %ecx
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x336d4
movq %r14, %rdi
callq 0x6747
movq %rax, %r15
movb 0x28(%rax), %al
movl %eax, %ecx
andb $0x11, %cl
cmpb $0x1, %cl
jne 0x23e5a
movq 0x20(%r14), %xmm0
pshufd $0x50, %xmm0, %xmm0     # xmm0 = xmm0[0,0,1,1]
movq 0x18(%r15), %xmm1
paddw %xmm0, %xmm1
leaq 0x10(%rsp), %r12
movq %xmm1, (%r12)
movq 0x10(%r15), %r13
movq %r14, %rdi
callq 0x6649
movzbl %al, %ecx
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x336d4
movb 0x28(%r15), %al
andb $0x12, %al
cmpb $0x2, %al
jne 0x23e9d
movq 0x20(%r14), %xmm0
pshufd $0x50, %xmm0, %xmm0     # xmm0 = xmm0[0,0,1,1]
movq 0x20(%r15), %xmm1
paddw %xmm0, %xmm1
leaq 0x10(%rsp), %r12
movq %xmm1, (%r12)
movq 0x10(%r15), %r13
movq %r14, %rdi
callq 0x6649
movzbl %al, %ecx
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x336d4
movq %r14, %rdi
callq 0x5308
movl %eax, %r12d
movq %r14, %rdi
callq 0x5332
movb 0x40(%r15), %cl
testb $0x2, %cl
jne 0x23eee
testb $0x4, %cl
jne 0x23f1f
testb $0x8, %cl
jne 0x23f53
testb $0x10, %cl
je 0x23f87
imull $-0x3, %eax, %edx
movzwl 0x30(%r15), %esi
addw 0x20(%r14), %si
addl %esi, %edx
movw %dx, 0x8(%rsp)
movw %si, 0xc(%rsp)
jmp 0x23f6e
movl 0x20(%r14), %eax
subl %r12d, %eax
movw %ax, 0x8(%rsp)
movzwl 0x24(%r14), %eax
addw %r12w, %ax
movw %ax, 0xc(%rsp)
imull $-0x3, %r12d, %eax
movzwl 0x30(%r15), %edx
addw 0x22(%r14), %dx
addl %edx, %eax
movw %ax, 0xa(%rsp)
jmp 0x23f82
movl 0x20(%r14), %eax
subl %r12d, %eax
movw %ax, 0x8(%rsp)
movzwl 0x24(%r14), %eax
addw %r12w, %ax
movw %ax, 0xc(%rsp)
movzwl 0x26(%r14), %eax
movl 0x30(%r15), %esi
leal (%r12,%r12,2), %edx
addl %eax, %edx
subl %esi, %eax
movw %ax, 0xa(%rsp)
subl %esi, %edx
jmp 0x23f82
movl 0x24(%r14), %edx
movl 0x30(%r15), %esi
leal (%rax,%rax,2), %edi
addl %edx, %edi
subl %esi, %edx
movw %dx, 0x8(%rsp)
subl %esi, %edi
movw %di, 0xc(%rsp)
movzwl 0x22(%r14), %edx
subl %eax, %edx
movw %dx, 0xa(%rsp)
movzwl 0x26(%r14), %edx
addw %ax, %dx
movw %dx, 0xe(%rsp)
testb $0x1e, %cl
je 0x23fd9
movq 0x38(%r15), %rsi
leaq 0x60(%rsp), %r12
movq %r12, %rdi
callq 0x74d4
movw $0x7c18, 0x6(%r12)      # imm = 0x7C18
movzbl 0x8(%r12), %ecx
movswl 0x30(%r15), %eax
imull %ecx, %eax
pushq $0x19
popq %rcx
cltd
idivl %ecx
movb %al, 0x8(%r12)
movq %r14, %rdi
callq 0x6649
movzbl %al, %ecx
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x336d4
movb $0x1, %al
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq