// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x66b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x103b0
movq -0x20(%rbp), %rsi
leaq 0x57c9b(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x103ae
cmpq $0x0, -0x20(%rbp)
jne 0x103c4
movq $0x0, -0x8(%rbp)
jmp 0x1062b
cmpq $0x0, 0x78fc4(%rip)     # 0x89390
jne 0x103de
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, 0x78fb2(%rip)     # 0x89390
cmpq $0x0, 0x78fb2(%rip)     # 0x89398
jne 0x103f8
movq -0x20(%rbp), %rdi
callq 0xa870
movq %rax, 0x78fa0(%rip)     # 0x89398
movq -0x20(%rbp), %rdi
movl $0x28, %esi
callq 0x9d60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x10429
movq -0x28(%rbp), %rsi
leaq 0x57c22(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x10427
cmpq $0x0, -0x28(%rbp)
jne 0x1043d
movq $0x0, -0x8(%rbp)
jmp 0x1062b
movq -0x28(%rbp), %rax
movb 0x24(%rax), %cl
andb $-0x9, %cl
orb $0x8, %cl
movb %cl, 0x24(%rax)
movq -0x28(%rbp), %rax
movw $0x0, -0x2c(%rbp)
movb $0x64, -0x2a(%rbp)
movb $0x64, -0x29(%rbp)
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
leaq 0x78b79(%rip), %rcx     # 0x88fe8
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movb 0x14(%rax), %cl
andb $-0x2, %cl
orb $0x0, %cl
movb %cl, 0x14(%rax)
movq -0x28(%rbp), %rax
movb 0x24(%rax), %cl
andb $-0x4, %cl
orb $0x0, %cl
movb %cl, 0x24(%rax)
movq -0x28(%rbp), %rax
movb 0x24(%rax), %cl
andb $-0x5, %cl
orb $0x0, %cl
movb %cl, 0x24(%rax)
movq -0x28(%rbp), %rax
movb 0x24(%rax), %cl
andb $-0x11, %cl
orb $0x0, %cl
movb %cl, 0x24(%rax)
movq -0x28(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x28(%rbp), %rax
movl $0x0, 0x1c(%rax)
movq -0x20(%rbp), %rdi
leaq 0x16c(%rip), %rsi       # 0x10640
callq 0x9cc0
movq -0x20(%rbp), %rdi
leaq 0xa3c(%rip), %rsi       # 0x10f20
callq 0x9d10
cmpq $0x0, -0x18(%rbp)
jne 0x1054a
movq -0x20(%rbp), %rdi
movl $0xc8, %edx
movl %edx, %esi
callq 0x8180
movq -0x20(%rbp), %rdi
movl $0x10, %esi
callq 0x9a50
callq 0x4cfc0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x10533
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdx
xorl %esi, %esi
callq 0x10ff0
jmp 0x10545
movq -0x20(%rbp), %rdi
xorl %esi, %esi
leaq 0x78aa8(%rip), %rdx     # 0x88fe8
callq 0x10ff0
jmp 0x1061a
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movb 0x24(%rax), %dl
shrb $0x3, %dl
andb $0x1, %dl
movq -0x28(%rbp), %rax
movb 0x24(%rax), %cl
andb $0x1, %dl
shlb $0x3, %dl
andb $-0x9, %cl
orb %dl, %cl
movb %cl, 0x24(%rax)
movq -0x40(%rbp), %rax
movb 0x24(%rax), %dl
andb $0x3, %dl
movq -0x28(%rbp), %rax
movb 0x24(%rax), %cl
andb $0x3, %dl
andb $-0x4, %cl
orb %dl, %cl
movb %cl, 0x24(%rax)
movq -0x40(%rbp), %rax
movb 0x24(%rax), %dl
shrb $0x2, %dl
andb $0x1, %dl
movq -0x28(%rbp), %rax
movb 0x24(%rax), %cl
andb $0x1, %dl
shlb $0x2, %dl
andb $-0x5, %cl
orb %dl, %cl
movb %cl, 0x24(%rax)
movq -0x40(%rbp), %rax
movb 0x24(%rax), %dl
shrb $0x4, %dl
andb $0x1, %dl
movq -0x28(%rbp), %rax
movb 0x24(%rax), %cl
andb $0x1, %dl
shlb $0x4, %dl
andb $-0x11, %cl
orb %dl, %cl
movb %cl, 0x24(%rax)
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
movq -0x40(%rbp), %rax
movb 0x14(%rax), %dl
andb $0x1, %dl
movq -0x28(%rbp), %rax
movb 0x14(%rax), %cl
andb $0x1, %dl
andb $-0x2, %cl
orb %dl, %cl
movb %cl, 0x14(%rax)
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rdi
callq 0x9250
movq -0x20(%rbp), %rdi
callq 0x11080
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)