// File: /workspace/github_c_makefile_star2_O1/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 0x455f
movq %rax, %rbx
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x9e0c
testq %rbx, %rbx
je 0x9e1d
cmpq $0x0, 0x565d3(%rip)     # 0x602c0
jne 0x9cfe
movq %rbx, %rdi
callq 0x6a6c
movq %rax, 0x565c2(%rip)     # 0x602c0
cmpq $0x0, 0x565c2(%rip)     # 0x602c8
jne 0x9d17
movq %rbx, %rdi
callq 0x6a90
movq %rax, 0x565b1(%rip)     # 0x602c8
movq %rbx, %rdi
movl $0x28, %esi
callq 0x64bc
movq %rax, %r14
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x9e21
testq %r14, %r14
je 0x9e1d
movb 0x24(%r14), %al
movl $0x64640000, (%r14)     # imm = 0x64640000
leaq 0x561c6(%rip), %rcx     # 0x5ff18
movq %rcx, 0x8(%r14)
andb $-0x2, 0x14(%r14)
orb $0x8, %al
andb $-0x18, %al
movb %al, 0x24(%r14)
movq $0x0, 0x18(%r14)
leaq 0x111(%rip), %rsi       # 0x9e83
movq %rbx, %rdi
callq 0x645c
leaq 0x6f6(%rip), %rsi       # 0xa477
movq %rbx, %rdi
callq 0x648c
testq %r15, %r15
je 0x9e32
movq %r15, %rdi
callq 0x6ad8
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 0x5e38
jmp 0x9e72
leaq 0x3522d(%rip), %rdi     # 0x3f040
movq %rbx, %rsi
callq 0x829e
jmp 0x9e1b
xorl %ebx, %ebx
jmp 0x9e7a
leaq 0x35218(%rip), %rdi     # 0x3f040
movq %r14, %rsi
callq 0x829e
jmp 0x9e30
movq %rbx, %rdi
movl $0xc8, %esi
movl $0xc8, %edx
callq 0x553f
movq %rbx, %rdi
movl $0x10, %esi
callq 0x62e7
callq 0x2e244
testq %rax, %rax
je 0x9e61
movq 0x8(%rax), %rdx
jmp 0x9e68
leaq 0x560b0(%rip), %rdx     # 0x5ff18
movq %rbx, %rdi
xorl %esi, %esi
callq 0xab49
movq %rbx, %rdi
callq 0xaba9
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq