// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw_basic.c
// Function: lv_draw_px
void lv_draw_px(lv_coord_t x, lv_coord_t y, const lv_area_t * mask_p, lv_color_t color, lv_opa_t opa)
{

    if(opa < LV_OPA_MIN) return;
    if(opa > LV_OPA_MAX) opa = LV_OPA_COVER;

    /*Pixel out of the mask*/
    if(x < mask_p->x1 || x > mask_p->x2 || y < mask_p->y1 || y > mask_p->y2) {
        return;
    }

    lv_disp_t * disp    = lv_refr_get_disp_refreshing();
    lv_disp_buf_t * vdb = lv_disp_get_buf(disp);
    uint32_t vdb_width  = lv_area_get_width(&vdb->area);

    /*Make the coordinates relative to VDB*/
    x -= vdb->area.x1;
    y -= vdb->area.y1;

    if(disp->driver.set_px_cb) {
        disp->driver.set_px_cb(&disp->driver, (uint8_t *)vdb->buf_act, vdb_width, x, y, color, opa);
    } else {
        bool scr_transp = false;
#if LV_COLOR_DEPTH == 32 && LV_COLOR_SCREEN_TRANSP
        scr_transp = disp->driver.screen_transp;
#endif

        lv_color_t * vdb_px_p = vdb->buf_act;
        vdb_px_p += y * vdb_width + x;

        if(scr_transp == false) {
            if(opa == LV_OPA_COVER) {
                *vdb_px_p = color;
            } else {
                *vdb_px_p = lv_color_mix(color, *vdb_px_p, opa);
            }
        } else {
#if LV_COLOR_DEPTH == 32 && LV_COLOR_SCREEN_TRANSP
            *vdb_px_p = color_mix_2_alpha(*vdb_px_p, (*vdb_px_p).ch.alpha, color, opa);
#endif
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %ecx, -0x40(%rbp)
movl %esi, %ecx
movl %edi, %esi
movl -0x40(%rbp), %edi
movb %r8b, %al
movw %di, -0x2(%rbp)
movw %si, -0x4(%rbp)
movw %cx, -0x6(%rbp)
movq %rdx, -0x10(%rbp)
movb %al, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x10, %eax
jge 0x58bd6
jmp 0x58d50
movzbl -0x11(%rbp), %eax
cmpl $0xfb, %eax
jle 0x58be5
movb $-0x1, -0x11(%rbp)
movswl -0x4(%rbp), %eax
movq -0x10(%rbp), %rcx
movswl (%rcx), %ecx
cmpl %ecx, %eax
jl 0x58c24
movswl -0x4(%rbp), %eax
movq -0x10(%rbp), %rcx
movswl 0x4(%rcx), %ecx
cmpl %ecx, %eax
jg 0x58c24
movswl -0x6(%rbp), %eax
movq -0x10(%rbp), %rcx
movswl 0x2(%rcx), %ecx
cmpl %ecx, %eax
jl 0x58c24
movswl -0x6(%rbp), %eax
movq -0x10(%rbp), %rcx
movswl 0x6(%rcx), %ecx
cmpl %ecx, %eax
jle 0x58c29
jmp 0x58d50
callq 0xafe0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xdbd0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
addq $0x1c, %rdi
callq 0x58d60
cwtl
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rax
movswl 0x1c(%rax), %ecx
movswl -0x4(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x4(%rbp)
movq -0x28(%rbp), %rax
movswl 0x1e(%rax), %ecx
movswl -0x6(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x6(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x58cc4
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rcx
movq 0x10(%rcx), %rsi
movl -0x2c(%rbp), %ecx
movw %cx, %dx
movw -0x4(%rbp), %cx
movw -0x6(%rbp), %r8w
movb -0x11(%rbp), %r10b
movswl %dx, %edx
movswl %cx, %ecx
movswl %r8w, %r8d
movzwl -0x2(%rbp), %r9d
movzbl %r10b, %r10d
movl %r10d, (%rsp)
callq *%rax
jmp 0x58d50
movb $0x0, -0x2d(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movswl -0x6(%rbp), %ecx
imull -0x2c(%rbp), %ecx
movswl -0x4(%rbp), %eax
addl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, %ecx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movb -0x2d(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x58d4c
movzbl -0x11(%rbp), %eax
cmpl $0xff, %eax
jne 0x58d17
movq -0x38(%rbp), %rax
movw -0x2(%rbp), %cx
movw %cx, (%rax)
jmp 0x58d4a
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rcx
movb -0x11(%rbp), %al
movw -0x2(%rbp), %dx
movzwl %dx, %edi
movzwl (%rcx), %esi
movzbl %al, %edx
callq 0x58d80
movw %ax, %cx
movq -0x48(%rbp), %rax
movw %cx, -0x3a(%rbp)
movw -0x3a(%rbp), %cx
movw %cx, (%rax)
jmp 0x58d4e
jmp 0x58d4e
jmp 0x58d50
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)