// File: /workspace/github_c_makefile_star2_O3/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 0x454f
movq %rax, %rbx
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x9d94
testq %rbx, %rbx
je 0x9da5
cmpq $0x0, 0x5664b(%rip)     # 0x602c0
jne 0x9c86
movq %rbx, %rdi
callq 0x6a8b
movq %rax, 0x5663a(%rip)     # 0x602c0
cmpq $0x0, 0x5663a(%rip)     # 0x602c8
jne 0x9c9f
movq %rbx, %rdi
callq 0x6aaf
movq %rax, 0x56629(%rip)     # 0x602c8
movq %rbx, %rdi
movl $0x28, %esi
callq 0x64db
movq %rax, %r14
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x9da9
testq %r14, %r14
je 0x9da5
movb 0x24(%r14), %al
movl $0x64640000, (%r14)     # imm = 0x64640000
leaq 0x5623e(%rip), %rcx     # 0x5ff18
movq %rcx, 0x8(%r14)
andb $-0x2, 0x14(%r14)
andb $-0x20, %al
orb $0x8, %al
movb %al, 0x24(%r14)
movq $0x0, 0x18(%r14)
leaq 0x111(%rip), %rsi       # 0x9e0b
movq %rbx, %rdi
callq 0x647b
leaq 0x69e(%rip), %rsi       # 0xa3a7
movq %rbx, %rdi
callq 0x64ab
testq %r15, %r15
je 0x9dba
movq %r15, %rdi
callq 0x6af7
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 0x5e54
jmp 0x9dfa
leaq 0x35335(%rip), %rdi     # 0x3f0d0
movq %rbx, %rsi
callq 0x8294
jmp 0x9da3
xorl %ebx, %ebx
jmp 0x9e02
leaq 0x35320(%rip), %rdi     # 0x3f0d0
movq %r14, %rsi
callq 0x8294
jmp 0x9db8
movq %rbx, %rdi
movl $0xc8, %esi
movl $0xc8, %edx
callq 0x5557
movq %rbx, %rdi
movl $0x10, %esi
callq 0x6306
callq 0x2e91c
testq %rax, %rax
je 0x9de9
movq 0x8(%rax), %rdx
jmp 0x9df0
leaq 0x56128(%rip), %rdx     # 0x5ff18
movq %rbx, %rdi
xorl %esi, %esi
callq 0xaab7
movq %rbx, %rdi
callq 0xab17
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq