// File: /workspace/github_c_makefile_star2_O1/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
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x2, %edx
jne 0x259e6
movq 0x3aaa7(%rip), %rax     # 0x60470
movzbl %bpl, %edx
movq %r14, %rdi
movq %rbx, %rsi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movq %r14, %rdi
xorl %esi, %esi
callq 0x25ddf
leaq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x798d
cmpb $0x1, %bpl
je 0x25a38
movzbl %bpl, %eax
testl %eax, %eax
jne 0x25c6f
leaq 0x18(%rsp), %r15
movw $0x0, 0xc(%r15)
leaq 0x20(%r14), %r12
movq %r14, %rdi
callq 0x69cc
movzbl %al, %ecx
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
jmp 0x25c6a
leaq 0x18(%rsp), %r15
movw $0x0, 0x12(%r15)
movb $0x0, 0x8(%r15)
leaq 0x20(%r14), %r12
movq %r14, %rdi
callq 0x69cc
movzbl %al, %ecx
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x365ac
movq %r14, %rdi
callq 0x6ad8
movq %rax, %r15
movb 0x28(%rax), %al
andb $0x11, %al
cmpb $0x1, %al
jne 0x25ac6
movq 0x18(%r15), %rax
leaq 0x10(%rsp), %r12
movq %rax, (%r12)
movl 0x20(%r14), %ecx
addl %ecx, %eax
movw %ax, (%r12)
movzwl 0x22(%r14), %eax
addw %ax, 0x2(%r12)
addw %cx, 0x4(%r12)
addw %ax, 0x6(%r12)
movq 0x10(%r15), %r13
movq %r14, %rdi
callq 0x69cc
movzbl %al, %ecx
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x365ac
movb 0x28(%r15), %al
andb $0x12, %al
cmpb $0x2, %al
jne 0x25b1c
movq 0x20(%r15), %rax
leaq 0x10(%rsp), %r12
movq %rax, (%r12)
movl 0x20(%r14), %ecx
addl %ecx, %eax
movw %ax, (%r12)
movzwl 0x22(%r14), %eax
addw %ax, 0x2(%r12)
addw %cx, 0x4(%r12)
addw %ax, 0x6(%r12)
movq 0x10(%r15), %r13
movq %r14, %rdi
callq 0x69cc
movzbl %al, %ecx
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x365ac
movq %r14, %rdi
callq 0x5651
movl %eax, %r12d
movq %r14, %rdi
callq 0x567b
movb 0x40(%r15), %cl
testb $0x2, %cl
jne 0x25b6f
testb $0x4, %cl
jne 0x25ba2
testb $0x8, %cl
jne 0x25bd6
testb $0x10, %cl
je 0x25c0a
leal (%rax,%rax,2), %ecx
movzwl 0x30(%r15), %edx
addw 0x20(%r14), %dx
movl %edx, %esi
subl %ecx, %esi
movw %si, 0x8(%rsp)
movw %dx, 0xc(%rsp)
jmp 0x25bf1
movl 0x20(%r14), %eax
subl %r12d, %eax
movw %ax, 0x8(%rsp)
movzwl 0x24(%r14), %eax
addw %r12w, %ax
movw %ax, 0xc(%rsp)
movzwl 0x30(%r15), %ecx
addw 0x22(%r14), %cx
leal (%r12,%r12,2), %eax
movl %ecx, %edx
subl %eax, %edx
movw %dx, 0xa(%rsp)
jmp 0x25c05
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), %edx
leal (%r12,%r12,2), %ecx
addl %eax, %ecx
subl %edx, %eax
movw %ax, 0xa(%rsp)
subl %edx, %ecx
jmp 0x25c05
movl 0x24(%r14), %ecx
movl 0x30(%r15), %edx
leal (%rax,%rax,2), %esi
addl %ecx, %esi
subl %edx, %ecx
movw %cx, 0x8(%rsp)
subl %edx, %esi
movw %si, 0xc(%rsp)
movzwl 0x22(%r14), %ecx
subl %eax, %ecx
movw %cx, 0xa(%rsp)
movzwl 0x26(%r14), %ecx
addw %ax, %cx
movw %cx, 0xe(%rsp)
testb $0x1e, 0x40(%r15)
je 0x25c6f
movq 0x38(%r15), %rsi
leaq 0x60(%rsp), %r12
movq %r12, %rdi
callq 0x798d
movw $0x7c18, 0x6(%r12)      # imm = 0x7C18
movzbl 0x8(%r12), %eax
movswl 0x30(%r15), %ecx
imull %eax, %ecx
movslq %ecx, %rax
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x23, %rax
addl %ecx, %eax
movb %al, 0x8(%r12)
movq %r14, %rdi
callq 0x69cc
movzbl %al, %ecx
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x365ac
movb $0x1, %al
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq