// File: /workspace/github_c_makefile_star2_O2/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 0x230ac
movq %rax, %rbx
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x1a39f
testq %rbx, %rbx
je 0x1a3b0
cmpq $0x0, 0x44123(%rip)     # 0x5e3b8
jne 0x1a2a6
movq %rbx, %rdi
callq 0x66db
movq %rax, 0x44112(%rip)     # 0x5e3b8
movq %rbx, %rdi
movl $0xa0, %esi
callq 0x6146
movq %rax, %r15
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x1a3bf
testq %r15, %r15
je 0x1a3b0
andq $0x0, 0x78(%r15)
leaq 0x43e35(%rip), %rax     # 0x5e110
movq %rax, 0x50(%r15)
leaq 0x43e72(%rip), %rax     # 0x5e158
movq %rax, 0x58(%r15)
leaq 0x43eaf(%rip), %rax     # 0x5e1a0
movq %rax, 0x60(%r15)
leaq 0x43eec(%rip), %rax     # 0x5e1e8
movq %rax, 0x68(%r15)
leaq 0x43f29(%rip), %rax     # 0x5e230
movq %rax, 0x70(%r15)
andb $-0x2, 0x82(%r15)
andw $0x0, 0x80(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x88(%r15)
andq $0x0, 0x98(%r15)
leaq 0x1f3(%rip), %rsi       # 0x1a529
movq %rbx, %rdi
callq 0x60e6
testq %r14, %r14
je 0x1a425
movq %r14, %rdi
callq 0x6747
movq %rax, %r15
movq %r14, %rdi
xorl %esi, %esi
callq 0x1a8ac
movq %rax, %r12
testq %rax, %rax
je 0x1a3d0
movq %r12, %rdi
callq 0x1a91a
testq %rax, %rax
je 0x1a37e
movq %rax, %rdi
callq 0x22110
movq %rax, %r13
jmp 0x1a381
xorl %r13d, %r13d
movq %r12, %rdi
callq 0x1abbe
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x1a9b8
movq %r14, %rdi
movq %r12, %rsi
jmp 0x1a357
leaq 0x20c9a(%rip), %rdi     # 0x3b040
movq %rbx, %rsi
callq 0x7b01
jmp 0x1a3ae
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x20c7a(%rip), %rdi     # 0x3b040
movq %r15, %rsi
callq 0x7b01
jmp 0x1a3ce
movq 0x50(%r15), %rdx
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x1a7e1
movq 0x58(%r15), %rdx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x1a7e1
movq 0x60(%r15), %rdx
pushq $0x6
popq %rsi
movq %rbx, %rdi
callq 0x1a7e1
movq 0x60(%r15), %rdx
pushq $0x7
popq %rsi
movq %rbx, %rdi
callq 0x1a7e1
movq 0x70(%r15), %rdx
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x1a7e1
movq %rbx, %rdi
callq 0x5ae7
jmp 0x1a3b2
pushq $0x64
popq %rsi
movq %rbx, %rdi
callq 0x24605
movq %rbx, %rdi
callq 0x245d9
movq %rax, %rdi
callq 0x1b5c2
movq %rbx, %rdi
movl $0xc8, %esi
movl $0x12c, %edx            # imm = 0x12C
callq 0x520e
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x1a7ce
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x23fed
callq 0x2be75
testq %rax, %rax
je 0x1a501
movq %rax, %r14
movq 0x258(%rax), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1a7e1
movq 0x260(%r14), %rdx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x1a7e1
movq 0x268(%r14), %rdx
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x1a7e1
movq 0x270(%r14), %rdx
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x1a7e1
movq 0x278(%r14), %rdx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x1a7e1
movq 0x280(%r14), %rdx
pushq $0x6
popq %rsi
movq %rbx, %rdi
callq 0x1a7e1
movq 0x288(%r14), %rdx
pushq $0x7
popq %rsi
movq %rbx, %rdi
callq 0x1a7e1
movq 0x290(%r14), %rdx
pushq $0x8
jmp 0x1a51b
leaq 0x43b78(%rip), %rdx     # 0x5e080
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1a7e1
leaq 0x43a8f(%rip), %rdx     # 0x5dfa8
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x1a7e1
jmp 0x1a3b2