// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_img_decoder.c
// Function: lv_img_decoder_built_in_read_line
lv_res_t lv_img_decoder_built_in_read_line(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc, lv_coord_t x,
                                                  lv_coord_t y, lv_coord_t len, uint8_t * buf)
{
    (void)decoder; /*Unused*/

    lv_res_t res = LV_RES_INV;

    if(dsc->header.cf == LV_IMG_CF_TRUE_COLOR || dsc->header.cf == LV_IMG_CF_TRUE_COLOR_ALPHA ||
       dsc->header.cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED) {
        /* For TRUE_COLOR images read line required only for files.
         * For variables the image data was returned in `open`*/
        if(dsc->src_type == LV_IMG_SRC_FILE) {
            res = lv_img_decoder_built_in_line_true_color(dsc, x, y, len, buf);
        }
    } else if(dsc->header.cf == LV_IMG_CF_ALPHA_1BIT || dsc->header.cf == LV_IMG_CF_ALPHA_2BIT ||
              dsc->header.cf == LV_IMG_CF_ALPHA_4BIT || dsc->header.cf == LV_IMG_CF_ALPHA_8BIT) {

        res = lv_img_decoder_built_in_line_alpha(dsc, x, y, len, buf);
    } else if(dsc->header.cf == LV_IMG_CF_INDEXED_1BIT || dsc->header.cf == LV_IMG_CF_INDEXED_2BIT ||
              dsc->header.cf == LV_IMG_CF_INDEXED_4BIT || dsc->header.cf == LV_IMG_CF_INDEXED_8BIT) {
        res = lv_img_decoder_built_in_line_indexed(dsc, x, y, len, buf);
    } else {
        LV_LOG_WARN("Built-in image decoder read not supports the color format");
        return LV_RES_INV;
    }

    return res;
}

// Assembly:
movl 0x1c(%rsi), %edi
andl $0x1f, %edi
xorl %eax, %eax
cmpl $0xe, %edi
ja 0x3e075
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %r9, %rbx
movl %ecx, %r13d
movl %edx, %r14d
movl $0x780, %ecx            # imm = 0x780
btl %edi, %ecx
jb 0x3dcd4
movl $0x7800, %ecx           # imm = 0x7800
btl %edi, %ecx
jae 0x3dd51
movzwl %r8w, %r9d
movl %r8d, 0x4(%rsp)
testw %r8w, %r8w
jle 0x3dc4f
movq 0x10(%rsi), %rax
movzwl 0x38(%rax), %eax
movl %eax, %ecx
shrl $0x8, %ecx
leaq (%r9,%r9,2), %rdx
xorl %edi, %edi
movb %al, (%rbx,%rdi)
movb %cl, 0x1(%rbx,%rdi)
addq $0x3, %rdi
cmpq %rdi, %rdx
jne 0x3dc3f
movq %r9, 0x18(%rsp)
movl 0x1c(%rsi), %edi
andl $0x1f, %edi
movq %rsi, 0x8(%rsp)
callq 0x3bfce
movq 0x8(%rsp), %r9
movl %eax, %r12d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %eax, %ecx
shll %cl, %ebp
movl 0x1c(%r9), %eax
movl %eax, %ecx
andl $0x1f, %ecx
addl $-0xb, %ecx
cmpl $0x3, %ecx
ja 0x3defa
leaq 0x56a7(%rip), %rdx      # 0x43338
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl %eax, %ecx
shrl $0xd, %ecx
movzbl %cl, %edx
andl $0x1c00, %eax           # imm = 0x1C00
cmpl $0x1, %eax
sbbw $-0x1, %dx
movzwl %dx, %eax
movswl %r13w, %ecx
imull %eax, %ecx
movswl %r14w, %esi
sarl $0x3, %esi
addl %ecx, %esi
notb %r14b
andb $0x7, %r14b
leaq 0x5679(%rip), %r15      # 0x43348
jmp 0x3df04
movl %r8d, 0x4(%rsp)
movq %rsi, %r15
callq 0x3bfce
movq %r15, %rdi
movl %eax, %r12d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %eax, %ecx
shll %cl, %ebp
movl 0x1c(%r15), %eax
movl %eax, %ecx
andl $0x1f, %ecx
addl $-0x7, %ecx
cmpl $0x3, %ecx
ja 0x3dfb7
leaq 0x561c(%rip), %rdx      # 0x43328
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl %eax, %ecx
shrl $0xd, %ecx
movzbl %cl, %r15d
andl $0x1c00, %eax           # imm = 0x1C00
cmpl $0x1, %eax
sbbw $-0x1, %r15w
movzwl %r15w, %eax
movswl %r13w, %ecx
imull %eax, %ecx
movswl %r14w, %eax
sarl $0x3, %eax
addl $0x8, %eax
movswl %ax, %esi
addl %ecx, %esi
notb %r14b
andb $0x7, %r14b
jmp 0x3dfbf
movl $0x70, %ecx
btl %edi, %ecx
jae 0x3e064
cmpb $0x1, 0x18(%rsi)
jne 0x3ddad
movl %r8d, %ebp
movq 0x38(%rsi), %r12
movq %rsi, %r15
callq 0x3bfce
movswl %r13w, %ecx
movl 0x1c(%r15), %edx
shrl $0xa, %edx
andl $0x7ff, %edx            # imm = 0x7FF
imull %ecx, %edx
movswl %r14w, %esi
addl %edx, %esi
movzbl %al, %r14d
imull %r14d, %esi
sarl $0x3, %esi
addl $0x4, %esi
movq (%r12), %rdi
callq 0x28eaf
testb %al, %al
je 0x3e076
xorl %eax, %eax
jmp 0x3e064
movl %eax, %edx
shrl $0xb, %edx
andl $0x3ff, %edx            # imm = 0x3FF
btl $0xa, %eax
adcw $0x0, %dx
movzwl %dx, %eax
movswl %r13w, %ecx
imull %eax, %ecx
movswl %r14w, %esi
sarl %esi
addl %ecx, %esi
notb %r14b
shlb $0x2, %r14b
andb $0x4, %r14b
leaq 0x53c5(%rip), %r15      # 0x431b0
jmp 0x3df04
shrl $0xa, %eax
andl $0x7ff, %eax            # imm = 0x7FF
movswl %r13w, %ecx
imull %eax, %ecx
movswl %r14w, %esi
addl %ecx, %esi
xorl %r14d, %r14d
movl %eax, %edx
jmp 0x3df01
movl %eax, %edx
shrl $0xc, %edx
andl $0x1ff, %edx            # imm = 0x1FF
andl $0xc00, %eax            # imm = 0xC00
cmpl $0x1, %eax
sbbw $-0x1, %dx
movzwl %dx, %eax
movswl %r13w, %ecx
imull %eax, %ecx
movswl %r14w, %esi
sarl $0x2, %esi
addl %ecx, %esi
notb %r14b
addb %r14b, %r14b
andb $0x6, %r14b
leaq 0x535a(%rip), %r15      # 0x431a4
jmp 0x3df04
movl %eax, %r15d
shrl $0xb, %r15d
andl $0x3ff, %r15d           # imm = 0x3FF
btl $0xa, %eax
adcw $0x0, %r15w
movzwl %r15w, %eax
movswl %r13w, %ecx
imull %eax, %ecx
movswl %r14w, %eax
sarl %eax
addl $0x40, %eax
movswl %ax, %esi
addl %ecx, %esi
notb %r14b
shlb $0x2, %r14b
andb $0x4, %r14b
jmp 0x3dfbf
shrl $0xa, %eax
andl $0x7ff, %eax            # imm = 0x7FF
movswl %r13w, %ecx
imull %eax, %ecx
movswl %r14w, %edx
leal (%rdx,%rcx), %esi
addl $0x400, %esi            # imm = 0x400
xorl %r14d, %r14d
movl %eax, %r15d
jmp 0x3dfbf
movl %eax, %r15d
shrl $0xc, %r15d
andl $0x1ff, %r15d           # imm = 0x1FF
andl $0xc00, %eax            # imm = 0xC00
cmpl $0x1, %eax
sbbw $-0x1, %r15w
movzwl %r15w, %eax
movswl %r13w, %ecx
imull %eax, %ecx
movswl %r14w, %eax
sarl $0x2, %eax
addl $0x10, %eax
movswl %ax, %esi
addl %ecx, %esi
notb %r14b
addb %r14b, %r14b
andb $0x6, %r14b
jmp 0x3dfbf
xorl %r14d, %r14d
xorl %esi, %esi
xorl %edx, %edx
xorl %r15d, %r15d
cmpb $0x0, 0x18(%r9)
je 0x3df3f
movq 0x38(%r9), %r13
movq (%r13), %rdi
addl $0x4, %esi
movq %rdx, 0x10(%rsp)
callq 0x28eaf
movq (%r13), %rdi
movzwl 0x10(%rsp), %edx
leaq 0x20(%rsp), %r13
movq %r13, %rsi
xorl %ecx, %ecx
callq 0x28dff
movq 0x8(%rsp), %r9
jmp 0x3df4a
movq 0x8(%r9), %rax
movl %esi, %r13d
addq 0x8(%rax), %r13
cmpw $0x0, 0x4(%rsp)
jle 0x3e062
notl %ebp
movb $0x8, %cl
subb %r12b, %cl
movq 0x18(%rsp), %rax
leaq (%rax,%rax,2), %rax
xorl %edx, %edx
movzbl %cl, %esi
movzbl (%r13), %r8d
movl %ebp, %edi
movl %r14d, %ecx
shll %cl, %edi
andl %r8d, %edi
shrq %cl, %rdi
movl 0x1c(%r9), %ecx
andl $0x1f, %ecx
cmpl $0xe, %ecx
je 0x3df8d
movb (%r15,%rdi), %dil
movb %dil, 0x2(%rbx,%rdx)
subb %r12b, %r14b
movzbl %r14b, %ecx
movl %ecx, %r14d
cmovsl %esi, %r14d
shrb $0x7, %cl
movzbl %cl, %ecx
addq %rcx, %r13
addq $0x3, %rdx
cmpq %rdx, %rax
jne 0x3df6b
jmp 0x3e062
xorl %esi, %esi
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x38(%rdi), %r13
cmpb $0x0, 0x18(%rdi)
je 0x3dfee
movq (%r13), %rdi
addl $0x4, %esi
callq 0x28eaf
movq (%r13), %rdi
movzwl %r15w, %edx
leaq 0x20(%rsp), %r15
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x28dff
jmp 0x3dff9
movq 0x8(%rdi), %rax
movl %esi, %r15d
addq 0x8(%rax), %r15
movl 0x4(%rsp), %eax
testw %ax, %ax
jle 0x3e062
notl %ebp
movb $0x8, %cl
subb %r12b, %cl
movzwl %ax, %eax
leaq (%rax,%rax,2), %rax
xorl %edx, %edx
movzbl %cl, %esi
movl %ebp, %edi
movl %r14d, %ecx
shll %cl, %edi
movzbl (%r15), %ecx
andl %ecx, %edi
movl %r14d, %ecx
shrq %cl, %rdi
movq 0x8(%r13), %rcx
movzwl (%rcx,%rdi,2), %ecx
movw %cx, (%rbx,%rdx)
movq 0x10(%r13), %rcx
movb (%rcx,%rdi), %cl
movb %cl, 0x2(%rbx,%rdx)
subb %r12b, %r14b
movl %r14d, %ecx
shrb $0x7, %cl
movzbl %cl, %ecx
addq %rcx, %r15
testb %r14b, %r14b
movzbl %r14b, %r14d
cmovsl %esi, %r14d
addq $0x3, %rdx
cmpq %rdx, %rax
jne 0x3e015
movb $0x1, %al
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movswl %bp, %eax
shrl $0x3, %r14d
imull %eax, %r14d
leaq 0x20(%rsp), %r15
movl $0x0, (%r15)
movq (%r12), %rdi
movq %rbx, %rsi
movl %r14d, %edx
movq %r15, %rcx
callq 0x28dff
cmpl (%r15), %r14d
sete %al
jmp 0x3e064