// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_img.c
// Function: lv_img_design
static bool lv_img_design(lv_obj_t * img, const lv_area_t * mask, lv_design_mode_t mode)
{
    const lv_style_t * style = lv_obj_get_style(img);
    lv_img_ext_t * ext       = lv_obj_get_ext_attr(img);

    if(mode == LV_DESIGN_COVER_CHK) {
        bool cover = false;
        if(ext->src_type == LV_IMG_SRC_UNKNOWN || ext->src_type == LV_IMG_SRC_SYMBOL) return false;

        if(ext->cf == LV_IMG_CF_TRUE_COLOR || ext->cf == LV_IMG_CF_RAW) cover = lv_area_is_in(mask, &img->coords);

        return cover;
    } else if(mode == LV_DESIGN_DRAW_MAIN) {
        if(ext->h == 0 || ext->w == 0) return true;
        lv_area_t coords;
        lv_opa_t opa_scale = lv_obj_get_opa_scale(img);

        lv_obj_get_coords(img, &coords);

        if(ext->src_type == LV_IMG_SRC_FILE || ext->src_type == LV_IMG_SRC_VARIABLE) {
            coords.x1 -= ext->offset.x;
            coords.y1 -= ext->offset.y;

            LV_LOG_TRACE("lv_img_design: start to draw image");
            lv_area_t cords_tmp;
            cords_tmp.y1 = coords.y1;
            cords_tmp.y2 = coords.y1 + ext->h - 1;

            for(; cords_tmp.y1 <= coords.y2; cords_tmp.y1 += ext->h, cords_tmp.y2 += ext->h) {
                cords_tmp.x1 = coords.x1;
                cords_tmp.x2 = coords.x1 + ext->w - 1;
                for(; cords_tmp.x1 <= coords.x2; cords_tmp.x1 += ext->w, cords_tmp.x2 += ext->w) {
                    lv_draw_img(&cords_tmp, mask, ext->src, style, opa_scale);
                }
            }
        } else if(ext->src_type == LV_IMG_SRC_SYMBOL) {
            LV_LOG_TRACE("lv_img_design: start to draw symbol");
            lv_style_t style_mod;
            lv_style_copy(&style_mod, style);
            style_mod.text.color = style->image.color;
            lv_draw_label(&coords, mask, &style_mod, opa_scale, ext->src, LV_TXT_FLAG_NONE, NULL, NULL, NULL, lv_obj_get_base_dir(img));
        } else {
            /*Trigger the error handler of image drawer*/
            LV_LOG_WARN("lv_img_design: image source type is unknown");
            lv_draw_img(&img->coords, mask, NULL, style, opa_scale);
        }
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa080
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x30(%rbp)
movzbl -0x19(%rbp), %eax
cmpl $0x2, %eax
jne 0x3a081
movb $0x0, -0x31(%rbp)
movq -0x30(%rbp), %rax
movb 0x10(%rax), %al
andb $0x3, %al
movzbl %al, %eax
cmpl $0x3, %eax
je 0x3a031
movq -0x30(%rbp), %rax
movb 0x10(%rax), %al
andb $0x3, %al
movzbl %al, %eax
cmpl $0x2, %eax
jne 0x3a03a
movb $0x0, -0x1(%rbp)
jmp 0x3a2b1
movq -0x30(%rbp), %rax
movb 0x10(%rax), %al
shrb $0x3, %al
movzbl %al, %eax
cmpl $0x4, %eax
je 0x3a05e
movq -0x30(%rbp), %rax
movb 0x10(%rax), %al
shrb $0x3, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x3a074
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x42ae0
andb $0x1, %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x3a2b1
movzbl -0x19(%rbp), %eax
cmpl $0x0, %eax
jne 0x3a2ab
movq -0x30(%rbp), %rax
movswl 0xe(%rax), %eax
cmpl $0x0, %eax
je 0x3a0a8
movq -0x30(%rbp), %rax
movswl 0xc(%rax), %eax
cmpl $0x0, %eax
jne 0x3a0b1
movb $0x1, -0x1(%rbp)
jmp 0x3a2b1
movq -0x10(%rbp), %rdi
callq 0xa710
movb %al, -0x3b(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x3a(%rbp), %rsi
callq 0x7fb0
movq -0x30(%rbp), %rax
movb 0x10(%rax), %al
andb $0x3, %al
movzbl %al, %eax
cmpl $0x1, %eax
je 0x3a0f0
movq -0x30(%rbp), %rax
movb 0x10(%rax), %al
andb $0x3, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x3a1dd
movq -0x30(%rbp), %rax
movswl 0x8(%rax), %ecx
movswl -0x3a(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x3a(%rbp)
movq -0x30(%rbp), %rax
movswl 0xa(%rax), %ecx
movswl -0x38(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x38(%rbp)
movw -0x38(%rbp), %ax
movw %ax, -0x42(%rbp)
movswl -0x38(%rbp), %eax
movq -0x30(%rbp), %rcx
movswl 0xe(%rcx), %ecx
addl %ecx, %eax
subl $0x1, %eax
movw %ax, -0x3e(%rbp)
movswl -0x42(%rbp), %eax
movswl -0x34(%rbp), %ecx
cmpl %ecx, %eax
jg 0x3a1d8
movw -0x3a(%rbp), %ax
movw %ax, -0x44(%rbp)
movswl -0x3a(%rbp), %eax
movq -0x30(%rbp), %rcx
movswl 0xc(%rcx), %ecx
addl %ecx, %eax
subl $0x1, %eax
movw %ax, -0x40(%rbp)
movswl -0x44(%rbp), %eax
movswl -0x36(%rbp), %ecx
cmpl %ecx, %eax
jg 0x3a1ad
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rax
movq (%rax), %rdx
movq -0x28(%rbp), %rcx
leaq -0x44(%rbp), %rdi
movzbl -0x3b(%rbp), %r8d
callq 0x61d50
movq -0x30(%rbp), %rax
movswl 0xc(%rax), %ecx
movswl -0x44(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x44(%rbp)
movq -0x30(%rbp), %rax
movswl 0xc(%rax), %ecx
movswl -0x40(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x40(%rbp)
jmp 0x3a15e
jmp 0x3a1af
movq -0x30(%rbp), %rax
movswl 0xe(%rax), %ecx
movswl -0x42(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x42(%rbp)
movq -0x30(%rbp), %rax
movswl 0xe(%rax), %ecx
movswl -0x3e(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x3e(%rbp)
jmp 0x3a131
jmp 0x3a2a9
movq -0x30(%rbp), %rax
movb 0x10(%rax), %al
andb $0x3, %al
movzbl %al, %eax
cmpl $0x2, %eax
jne 0x3a289
movq -0x28(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0xc550
movq -0x28(%rbp), %rax
movw 0x38(%rax), %ax
movw %ax, -0x70(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xa8(%rbp)
movb -0x3b(%rbp), %al
movb %al, -0x99(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7180
movq -0xa8(%rbp), %rsi
movb -0x99(%rbp), %cl
movq -0x98(%rbp), %r8
leaq -0x3a(%rbp), %rdi
leaq -0x90(%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 0x3a2a7
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
movzbl -0x3b(%rbp), %r8d
callq 0x61d50
jmp 0x3a2a9
jmp 0x3a2ab
jmp 0x3a2ad
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xd0, %rsp
popq %rbp
retq
nop