// File: /workspace/github_c_makefile_star2_O1/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 0x24c9c
movq %rax, %rbx
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x1b946
testq %rbx, %rbx
je 0x1b957
cmpq $0x0, 0x44be7(%rip)     # 0x603b8
jne 0x1b7e2
movq %rbx, %rdi
callq 0x6a6c
movq %rax, 0x44bd6(%rip)     # 0x603b8
movq %rbx, %rdi
movl $0xa0, %esi
callq 0x64bc
movq %rax, %r15
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x1b966
testq %r15, %r15
je 0x1b957
xorl %eax, %eax
movq %rax, 0x78(%r15)
leaq 0x448f8(%rip), %rcx     # 0x60110
movq %rcx, 0x50(%r15)
leaq 0x44935(%rip), %rcx     # 0x60158
movq %rcx, 0x58(%r15)
leaq 0x44972(%rip), %rcx     # 0x601a0
movq %rcx, 0x60(%r15)
leaq 0x449af(%rip), %rcx     # 0x601e8
movq %rcx, 0x68(%r15)
leaq 0x449ec(%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       # 0x1bab2
movq %rbx, %rdi
callq 0x645c
testq %r14, %r14
je 0x1b977
movq %r14, %rdi
callq 0x6ad8
movq %rax, %r15
movq %r14, %rdi
xorl %esi, %esi
callq 0x1be72
testq %rax, %rax
je 0x1b8e7
movq %rax, %r12
movq %r12, %rdi
callq 0x1bee0
testq %rax, %rax
je 0x1b8bb
movq %rax, %rdi
callq 0x23c08
movq %rax, %r13
jmp 0x1b8be
xorl %r13d, %r13d
movq %r12, %rdi
callq 0x1c1a6
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x1bf7c
movq %r14, %rdi
movq %r12, %rsi
callq 0x1be72
movq %rax, %r12
testq %rax, %rax
jne 0x1b8a1
movq 0x50(%r15), %rdx
movq %rbx, %rdi
movl $0x4, %esi
callq 0x1bd74
movq 0x58(%r15), %rdx
movq %rbx, %rdi
movl $0x5, %esi
callq 0x1bd74
movq 0x60(%r15), %rdx
movq %rbx, %rdi
movl $0x6, %esi
callq 0x1bd74
movq 0x60(%r15), %rdx
movq %rbx, %rdi
movl $0x7, %esi
callq 0x1bd74
movq 0x70(%r15), %rdx
movq %rbx, %rdi
movl $0x8, %esi
callq 0x1bd74
movq %rbx, %rdi
callq 0x5e38
jmp 0x1b959
leaq 0x236f3(%rip), %rdi     # 0x3f040
movq %rbx, %rsi
callq 0x829e
jmp 0x1b955
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x236d3(%rip), %rdi     # 0x3f040
movq %r15, %rsi
callq 0x829e
jmp 0x1b975
movq %rbx, %rdi
movl $0x64, %esi
callq 0x262b4
movq %rbx, %rdi
callq 0x26288
movq %rax, %rdi
movl $0x2, %esi
movl $0x2, %edx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x22602
movq %rbx, %rdi
movl $0xc8, %esi
movl $0x12c, %edx            # imm = 0x12C
callq 0x553f
movq %rbx, %rdi
callq 0x26288
movq %rax, %rdi
movl $0x3, %esi
callq 0x2259a
movq %rbx, %rdi
movl $0x2, %esi
callq 0x25c83
callq 0x2e244
testq %rax, %rax
je 0x1ba88
movq %rax, %r14
movq 0x258(%rax), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1bd74
movq 0x260(%r14), %rdx
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1bd74
movq 0x268(%r14), %rdx
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1bd74
movq 0x270(%r14), %rdx
movq %rbx, %rdi
movl $0x4, %esi
callq 0x1bd74
movq 0x278(%r14), %rdx
movq %rbx, %rdi
movl $0x5, %esi
callq 0x1bd74
movq 0x280(%r14), %rdx
movq %rbx, %rdi
movl $0x6, %esi
callq 0x1bd74
movq 0x288(%r14), %rdx
movq %rbx, %rdi
movl $0x7, %esi
callq 0x1bd74
movq 0x290(%r14), %rdx
movq %rbx, %rdi
movl $0x8, %esi
jmp 0x1baa8
leaq 0x445f1(%rip), %rdx     # 0x60080
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1bd74
leaq 0x44508(%rip), %rdx     # 0x5ffa8
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1bd74
jmp 0x1b959