// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_img_decoder.c
// Function: lv_img_decoder_built_in_info
lv_res_t lv_img_decoder_built_in_info(lv_img_decoder_t * decoder, const void * src, lv_img_header_t * header)
{
    (void)decoder; /*Unused*/

    lv_img_src_t src_type = lv_img_src_get_type(src);
    if(src_type == LV_IMG_SRC_VARIABLE) {
        lv_img_cf_t cf = ((lv_img_dsc_t *)src)->header.cf;
        if(cf < CF_BUILT_IN_FIRST || cf > CF_BUILT_IN_LAST) return LV_RES_INV;

        header->w  = ((lv_img_dsc_t *)src)->header.w;
        header->h  = ((lv_img_dsc_t *)src)->header.h;
        header->cf = ((lv_img_dsc_t *)src)->header.cf;
    }
#if LV_USE_FILESYSTEM
    else if(src_type == LV_IMG_SRC_FILE) {
        lv_fs_file_t file;
        lv_fs_res_t res;
        uint32_t rn;
        res = lv_fs_open(&file, src, LV_FS_MODE_RD);
        if(res == LV_FS_RES_OK) {
            res = lv_fs_read(&file, header, sizeof(lv_img_header_t), &rn);
            lv_fs_close(&file);
        }

        if(header->cf < CF_BUILT_IN_FIRST || header->cf > CF_BUILT_IN_LAST) return LV_RES_INV;

    }
#endif
    else if(src_type == LV_IMG_SRC_SYMBOL) {
        /*The size depend on the font but it is unknown here. It should be handled outside of the
         * function*/
        header->w = 1;
        header->h = 1;
        /* Symbols always have transparent parts. Important because of cover check in the design
         * function. The actual value doesn't matter because lv_draw_label will draw it*/
        header->cf = LV_IMG_CF_ALPHA_1BIT;
    } else {
        LV_LOG_WARN("Image get info found unknown src type");
        return LV_RES_INV;
    }
    return LV_RES_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x63110
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
cmpl $0x0, %eax
jne 0x6522c
movq -0x18(%rbp), %rax
movl (%rax), %eax
andl $0x1f, %eax
movb %al, -0x22(%rbp)
movzbl -0x22(%rbp), %eax
cmpl $0x4, %eax
jl 0x651bb
movzbl -0x22(%rbp), %eax
cmpl $0xe, %eax
jle 0x651c4
movb $0x0, -0x1(%rbp)
jmp 0x652e8
movq -0x18(%rbp), %rax
movl (%rax), %edx
shrl $0xa, %edx
andl $0x7ff, %edx            # imm = 0x7FF
movq -0x20(%rbp), %rax
movl (%rax), %ecx
andl $0x7ff, %edx            # imm = 0x7FF
shll $0xa, %edx
andl $0xffe003ff, %ecx       # imm = 0xFFE003FF
orl %edx, %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movl (%rax), %edx
shrl $0x15, %edx
movq -0x20(%rbp), %rax
movl (%rax), %ecx
andl $0x7ff, %edx            # imm = 0x7FF
shll $0x15, %edx
andl $0x1fffff, %ecx         # imm = 0x1FFFFF
orl %edx, %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movl (%rax), %edx
andl $0x1f, %edx
movq -0x20(%rbp), %rax
movl (%rax), %ecx
andl $0x1f, %edx
andl $-0x20, %ecx
orl %edx, %ecx
movl %ecx, (%rax)
jmp 0x652e4
movzbl -0x21(%rbp), %eax
cmpl $0x1, %eax
jne 0x65299
movq -0x18(%rbp), %rsi
leaq -0x38(%rbp), %rdi
movl $0x2, %edx
callq 0x43440
movb %al, -0x39(%rbp)
movzbl -0x39(%rbp), %eax
cmpl $0x0, %eax
jne 0x65275
movq -0x20(%rbp), %rsi
leaq -0x38(%rbp), %rdi
movl $0x4, %edx
leaq -0x40(%rbp), %rcx
callq 0x437a0
movb %al, -0x39(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x43650
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x1f, %eax
cmpl $0x4, %eax
jl 0x65291
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x1f, %eax
cmpl $0xe, %eax
jle 0x65297
movb $0x0, -0x1(%rbp)
jmp 0x652e8
jmp 0x652e2
movzbl -0x21(%rbp), %eax
cmpl $0x2, %eax
jne 0x652da
movq -0x20(%rbp), %rax
movl (%rax), %ecx
andl $0xffe003ff, %ecx       # imm = 0xFFE003FF
orl $0x400, %ecx            # imm = 0x400
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movl (%rax), %ecx
andl $0x1fffff, %ecx         # imm = 0x1FFFFF
orl $0x200000, %ecx         # imm = 0x200000
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movl (%rax), %ecx
andl $-0x20, %ecx
orl $0xb, %ecx
movl %ecx, (%rax)
jmp 0x652e0
movb $0x0, -0x1(%rbp)
jmp 0x652e8
jmp 0x652e2
jmp 0x652e4
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)