// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movl %ecx, %r13d
movl 0x1c(%rsi), %edi
movl %edi, %ecx
andl $0x1f, %ecx
xorl %eax, %eax
cmpl $0xe, %ecx
ja 0x3e40b
movq %r9, %rbx
movl %edx, %r14d
movl $0x780, %edx            # imm = 0x780
btl %ecx, %edx
jb 0x3e077
movl $0x7800, %edx           # imm = 0x7800
btl %ecx, %edx
jae 0x3e0f6
movzwl %r8w, %r9d
testw %r8w, %r8w
jle 0x3dff0
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 0x3dfdd
movl 0x1c(%rsi), %edi
movq %r9, 0x18(%rsp)
movl %r8d, 0x4(%rsp)
andl $0x1f, %edi
movq %rsi, 0x8(%rsp)
callq 0x3c3ca
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 0x3e2a1
leaq 0x54f4(%rip), %rdx      # 0x43528
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 0x54c6(%rip), %r15      # 0x43538
jmp 0x3e2ab
movl %r8d, 0x4(%rsp)
movl %ecx, %edi
movq %rsi, %r15
callq 0x3c3ca
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 0x3e35e
leaq 0x5467(%rip), %rdx      # 0x43518
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 0x3e366
movl $0x70, %edx
btl %ecx, %edx
jae 0x3e40b
cmpb $0x1, 0x18(%rsi)
jne 0x3e154
movl %r8d, %ebp
movq 0x38(%rsi), %r12
movl %ecx, %edi
movq %rsi, %r15
callq 0x3c3ca
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 0x2953f
testb %al, %al
je 0x3e41d
xorl %eax, %eax
jmp 0x3e40b
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 0x520e(%rip), %r15      # 0x433a0
jmp 0x3e2ab
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 0x3e2a8
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 0x51a1(%rip), %r15      # 0x43392
jmp 0x3e2ab
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 0x3e366
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 0x3e366
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 0x3e366
xorl %r14d, %r14d
xorl %esi, %esi
xorl %edx, %edx
xorl %r15d, %r15d
cmpb $0x0, 0x18(%r9)
je 0x3e2e6
movq 0x38(%r9), %r13
movq (%r13), %rdi
addl $0x4, %esi
movq %rdx, 0x10(%rsp)
callq 0x2953f
movq (%r13), %rdi
movzwl 0x10(%rsp), %edx
leaq 0x20(%rsp), %r13
movq %r13, %rsi
xorl %ecx, %ecx
callq 0x2948f
movq 0x8(%rsp), %r9
jmp 0x3e2f1
movq 0x8(%r9), %rax
movl %esi, %r13d
addq 0x8(%rax), %r13
cmpw $0x0, 0x4(%rsp)
jle 0x3e409
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 0x3e334
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 0x3e312
jmp 0x3e409
xorl %esi, %esi
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x38(%rdi), %r13
cmpb $0x0, 0x18(%rdi)
je 0x3e395
movq (%r13), %rdi
addl $0x4, %esi
callq 0x2953f
movq (%r13), %rdi
movzwl %r15w, %edx
leaq 0x20(%rsp), %r15
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x2948f
jmp 0x3e3a0
movq 0x8(%rdi), %rax
movl %esi, %r15d
addq 0x8(%rax), %r15
movl 0x4(%rsp), %eax
testw %ax, %ax
jle 0x3e409
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 0x3e3bc
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 0x2948f
cmpl (%r15), %r14d
sete %al
jmp 0x3e40b