// File: /workspace/github_c_makefile_star2_O3/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_list.c
// Function: lv_list_create
lv_obj_t * lv_list_create(lv_obj_t * par, const lv_obj_t * copy)
{
    LV_LOG_TRACE("list create started");

    /*Create the ancestor basic object*/
    lv_obj_t * new_list = lv_page_create(par, copy);
    LV_ASSERT_MEM(new_list);
    if(new_list == NULL) return NULL;

    if(ancestor_page_signal == NULL) ancestor_page_signal = lv_obj_get_signal_cb(new_list);

    lv_list_ext_t * ext = lv_obj_allocate_ext_attr(new_list, sizeof(lv_list_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;

    ext->style_img                        = NULL;
    ext->styles_btn[LV_BTN_STATE_REL]     = &lv_style_btn_rel;
    ext->styles_btn[LV_BTN_STATE_PR]      = &lv_style_btn_pr;
    ext->styles_btn[LV_BTN_STATE_TGL_REL] = &lv_style_btn_tgl_rel;
    ext->styles_btn[LV_BTN_STATE_TGL_PR]  = &lv_style_btn_tgl_pr;
    ext->styles_btn[LV_BTN_STATE_INA]     = &lv_style_btn_ina;
    ext->single_mode                      = false;
    ext->size                             = 0;

#if LV_USE_GROUP
    ext->last_sel     = NULL;
    ext->selected_btn = NULL;
    ext->last_clicked_btn = NULL;
#endif

    lv_obj_set_signal_cb(new_list, lv_list_signal);

    /*Init the new list object*/
    if(copy == NULL) {
        lv_page_set_anim_time(new_list, LV_LIST_DEF_ANIM_TIME);
        lv_page_set_scrl_fit2(new_list, LV_FIT_FLOOD, LV_FIT_TIGHT);
        lv_obj_set_size(new_list, 2 * LV_DPI, 3 * LV_DPI);
        lv_page_set_scrl_layout(new_list, LV_LIST_LAYOUT_DEF);
        lv_list_set_sb_mode(new_list, LV_SB_MODE_DRAG);

        /*Set the default styles*/
        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            lv_list_set_style(new_list, LV_LIST_STYLE_BG, th->style.list.bg);
            lv_list_set_style(new_list, LV_LIST_STYLE_SCRL, th->style.list.scrl);
            lv_list_set_style(new_list, LV_LIST_STYLE_SB, th->style.list.sb);
            lv_list_set_style(new_list, LV_LIST_STYLE_BTN_REL, th->style.list.btn.rel);
            lv_list_set_style(new_list, LV_LIST_STYLE_BTN_PR, th->style.list.btn.pr);
            lv_list_set_style(new_list, LV_LIST_STYLE_BTN_TGL_REL, th->style.list.btn.tgl_rel);
            lv_list_set_style(new_list, LV_LIST_STYLE_BTN_TGL_PR, th->style.list.btn.tgl_pr);
            lv_list_set_style(new_list, LV_LIST_STYLE_BTN_INA, th->style.list.btn.ina);
        } else {
            lv_list_set_style(new_list, LV_LIST_STYLE_BG, &lv_style_transp_fit);
            lv_list_set_style(new_list, LV_LIST_STYLE_SCRL, &lv_style_pretty);
        }
    } else {
        lv_list_ext_t * copy_ext = lv_obj_get_ext_attr(copy);

        lv_obj_t * copy_btn = lv_list_get_next_btn(copy, NULL);
        while(copy_btn) {
            const void * img_src = NULL;
#if LV_USE_IMG
            lv_obj_t * copy_img = lv_list_get_btn_img(copy_btn);
            if(copy_img) img_src = lv_img_get_src(copy_img);
#endif
            lv_list_add_btn(new_list, img_src, lv_list_get_btn_text(copy_btn));
            copy_btn = lv_list_get_next_btn(copy, copy_btn);
        }

        lv_list_set_style(new_list, LV_LIST_STYLE_BTN_REL, copy_ext->styles_btn[LV_BTN_STATE_REL]);
        lv_list_set_style(new_list, LV_LIST_STYLE_BTN_PR, copy_ext->styles_btn[LV_BTN_STATE_PR]);
        lv_list_set_style(new_list, LV_LIST_STYLE_BTN_TGL_REL, copy_ext->styles_btn[LV_BTN_STATE_TGL_REL]);
        lv_list_set_style(new_list, LV_LIST_STYLE_BTN_TGL_PR, copy_ext->styles_btn[LV_BTN_STATE_TGL_REL]);
        lv_list_set_style(new_list, LV_LIST_STYLE_BTN_INA, copy_ext->styles_btn[LV_BTN_STATE_INA]);

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

    LV_LOG_INFO("list created");

    return new_list;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
callq 0x25398
movq %rax, %rbx
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x1c15e
testq %rbx, %rbx
je 0x1c16f
cmpq $0x0, 0x443cf(%rip)     # 0x603b8
jne 0x1bffa
movq %rbx, %rdi
callq 0x6a8b
movq %rax, 0x443be(%rip)     # 0x603b8
movq %rbx, %rdi
movl $0xa0, %esi
callq 0x64db
movq %rax, %r15
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x1c17e
testq %r15, %r15
je 0x1c16f
xorl %eax, %eax
movq %rax, 0x78(%r15)
leaq 0x440e0(%rip), %rcx     # 0x60110
movq %rcx, 0x50(%r15)
leaq 0x4411d(%rip), %rcx     # 0x60158
movq %rcx, 0x58(%r15)
leaq 0x4415a(%rip), %rcx     # 0x601a0
movq %rcx, 0x60(%r15)
leaq 0x44197(%rip), %rcx     # 0x601e8
movq %rcx, 0x68(%r15)
leaq 0x441d4(%rip), %rcx     # 0x60230
movq %rcx, 0x70(%r15)
andb $-0x2, 0x82(%r15)
movw $0x0, 0x80(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x88(%r15)
movq %rax, 0x98(%r15)
leaq 0x23f(%rip), %rsi       # 0x1c2ca
movq %rbx, %rdi
callq 0x647b
testq %r14, %r14
je 0x1c18f
movq %r14, %rdi
callq 0x6af7
movq %rax, %r15
movq %r14, %rdi
xorl %esi, %esi
callq 0x1c66d
testq %rax, %rax
je 0x1c0ff
movq %rax, %r12
movq %r12, %rdi
callq 0x1c6db
testq %rax, %rax
je 0x1c0d3
movq %rax, %rdi
callq 0x24363
movq %rax, %r13
jmp 0x1c0d6
xorl %r13d, %r13d
movq %r12, %rdi
callq 0x1c9a1
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x1c777
movq %r14, %rdi
movq %r12, %rsi
callq 0x1c66d
movq %rax, %r12
testq %rax, %rax
jne 0x1c0b9
movq 0x50(%r15), %rdx
movq %rbx, %rdi
movl $0x4, %esi
callq 0x1c592
movq 0x58(%r15), %rdx
movq %rbx, %rdi
movl $0x5, %esi
callq 0x1c592
movq 0x60(%r15), %rdx
movq %rbx, %rdi
movl $0x6, %esi
callq 0x1c592
movq 0x60(%r15), %rdx
movq %rbx, %rdi
movl $0x7, %esi
callq 0x1c592
movq 0x70(%r15), %rdx
movq %rbx, %rdi
movl $0x8, %esi
callq 0x1c592
movq %rbx, %rdi
callq 0x5e54
jmp 0x1c171
leaq 0x22f6b(%rip), %rdi     # 0x3f0d0
movq %rbx, %rsi
callq 0x8294
jmp 0x1c16d
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x22f4b(%rip), %rdi     # 0x3f0d0
movq %r15, %rsi
callq 0x8294
jmp 0x1c18d
movq %rbx, %rdi
movl $0x64, %esi
callq 0x2698a
movq %rbx, %rdi
callq 0x2695e
movq %rax, %rdi
movl $0x2, %esi
movl $0x2, %edx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x22d84
movq %rbx, %rdi
movl $0xc8, %esi
movl $0x12c, %edx            # imm = 0x12C
callq 0x5557
movq %rbx, %rdi
callq 0x2695e
movq %rax, %rdi
movl $0x3, %esi
callq 0x22d1c
movq %rbx, %rdi
movl $0x2, %esi
callq 0x2636f
callq 0x2e91c
testq %rax, %rax
je 0x1c2a0
movq %rax, %r14
movq 0x258(%rax), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1c592
movq 0x260(%r14), %rdx
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1c592
movq 0x268(%r14), %rdx
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1c592
movq 0x270(%r14), %rdx
movq %rbx, %rdi
movl $0x4, %esi
callq 0x1c592
movq 0x278(%r14), %rdx
movq %rbx, %rdi
movl $0x5, %esi
callq 0x1c592
movq 0x280(%r14), %rdx
movq %rbx, %rdi
movl $0x6, %esi
callq 0x1c592
movq 0x288(%r14), %rdx
movq %rbx, %rdi
movl $0x7, %esi
callq 0x1c592
movq 0x290(%r14), %rdx
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x1c2c0
leaq 0x43dd9(%rip), %rdx     # 0x60080
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1c592
leaq 0x43cf0(%rip), %rdx     # 0x5ffa8
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1c592
jmp 0x1c171