// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_cpicker.c
// Function: lv_cpicker_create
lv_obj_t * lv_cpicker_create(lv_obj_t * par, const lv_obj_t * copy)
{
    LV_LOG_TRACE("color_picker create started");

    lv_obj_t * new_cpicker = lv_obj_create(par, copy);
    LV_ASSERT_MEM(new_cpicker);
    if(new_cpicker == NULL) return NULL;

    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_cpicker);
    if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_cb(new_cpicker);

    /*Allocate the extended data*/
    lv_cpicker_ext_t * ext = lv_obj_allocate_ext_attr(new_cpicker, sizeof(lv_cpicker_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;

    /*Initialize the allocated 'ext' */
    ext->type = LV_CPICKER_DEF_TYPE;
    ext->hsv = LV_CPICKER_DEF_HSV;
    ext->indic.style = &lv_style_plain;
    ext->indic.colored = 0;
    ext->color_mode = LV_CPICKER_COLOR_MODE_HUE;
    ext->color_mode_fixed = 0;
    ext->preview = 0;
    ext->last_click_time = 0;
    ext->last_change_time = 0;

    /*The signal and design functions are not copied so set them here*/
    lv_obj_set_signal_cb(new_cpicker, lv_cpicker_signal);
    lv_obj_set_design_cb(new_cpicker, lv_cpicker_design);

    /*If no copy do the basic initialization*/
    if(copy == NULL) {
        lv_obj_set_size(new_cpicker, LV_DPI * 2, LV_DPI * 2);
        lv_obj_set_protect(new_cpicker, LV_PROTECT_PRESS_LOST);
        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            lv_cpicker_set_style(new_cpicker, LV_CPICKER_STYLE_MAIN, th->style.bg);
        } else {
            lv_cpicker_set_style(new_cpicker, LV_CPICKER_STYLE_MAIN, &lv_style_plain);
        }
    }
    /*Copy 'copy'*/
    else {
        lv_cpicker_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
        ext->type = copy_ext->type;
        ext->color_mode = copy_ext->color_mode;
        ext->color_mode_fixed = copy_ext->color_mode_fixed;
        ext->preview = copy_ext->preview;
        ext->hsv = copy_ext->hsv;
        ext->indic.colored = copy_ext->indic.colored;
        ext->indic.style = copy_ext->indic.style;

        /*Refresh the style with new signal function*/
        lv_obj_refresh_style(new_cpicker);
    }
    refr_indic_pos(new_cpicker);

    LV_LOG_INFO("color_picker created");

    return new_cpicker;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
callq 0x42c9
movq %rax, %rbx
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x955f
testq %rbx, %rbx
je 0x9570
cmpq $0x0, 0x54e7b(%rip)     # 0x5e2c0
jne 0x9456
movq %rbx, %rdi
callq 0x66db
movq %rax, 0x54e6a(%rip)     # 0x5e2c0
cmpq $0x0, 0x54e6a(%rip)     # 0x5e2c8
jne 0x946f
movq %rbx, %rdi
callq 0x66ff
movq %rax, 0x54e59(%rip)     # 0x5e2c8
pushq $0x28
popq %rsi
movq %rbx, %rdi
callq 0x6146
movq %rax, %r14
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x9574
testq %r14, %r14
je 0x9570
movb 0x24(%r14), %al
movl $0x64640000, (%r14)     # imm = 0x64640000
leaq 0x54a70(%rip), %rcx     # 0x5df18
movq %rcx, 0x8(%r14)
andb $-0x2, 0x14(%r14)
andb $-0x20, %al
orb $0x8, %al
movb %al, 0x24(%r14)
andq $0x0, 0x18(%r14)
leaq 0x10f(%rip), %rsi       # 0x95d4
movq %rbx, %rdi
callq 0x60e6
leaq 0x654(%rip), %rsi       # 0x9b28
movq %rbx, %rdi
callq 0x6116
testq %r15, %r15
je 0x9585
movq %r15, %rdi
callq 0x6747
movb 0x24(%rax), %dl
andb $0x8, %dl
movb 0x14(%r14), %cl
movb 0x24(%r14), %sil
andb $-0x9, %sil
orb %dl, %sil
movb %sil, 0x24(%r14)
movb 0x24(%rax), %dl
andb $0x3, %dl
andb $-0x4, %sil
orb %dl, %sil
movb %sil, 0x24(%r14)
movb 0x24(%rax), %dl
andb $0x4, %dl
andb $-0x5, %sil
orb %dl, %sil
movb %sil, 0x24(%r14)
movb 0x24(%rax), %dl
andb $0x10, %dl
andb $-0x11, %sil
orb %dl, %sil
movb %sil, 0x24(%r14)
movl (%rax), %edx
movl %edx, (%r14)
movb 0x14(%rax), %dl
andb $0x1, %dl
andb $-0x2, %cl
orb %dl, %cl
movb %cl, 0x14(%r14)
movq 0x8(%rax), %rax
movq %rax, 0x8(%r14)
movq %rbx, %rdi
callq 0x5ae7
jmp 0x95c3
leaq 0x31ada(%rip), %rdi     # 0x3b040
movq %rbx, %rsi
callq 0x7b01
jmp 0x956e
xorl %ebx, %ebx
jmp 0x95cb
leaq 0x31ac5(%rip), %rdi     # 0x3b040
movq %r14, %rsi
callq 0x7b01
jmp 0x9583
movq %rbx, %rdi
movl $0xc8, %esi
movl $0xc8, %edx
callq 0x520e
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x5f71
callq 0x2be75
testq %rax, %rax
je 0x95b2
movq 0x8(%rax), %rdx
jmp 0x95b9
leaq 0x5495f(%rip), %rdx     # 0x5df18
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa1cb
movq %rbx, %rdi
callq 0xa22b
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq