// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x3c400
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x2cbf0
movq -0x20(%rbp), %rsi
leaq 0x3b45b(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x2cbee
cmpq $0x0, -0x20(%rbp)
jne 0x2cc04
movq $0x0, -0x8(%rbp)
jmp 0x2cf85
cmpq $0x0, 0x5c87c(%rip)     # 0x89488
jne 0x2cc1e
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, 0x5c86a(%rip)     # 0x89488
movq -0x20(%rbp), %rdi
movl $0xa0, %esi
callq 0x9d60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x2cc4f
movq -0x28(%rbp), %rsi
leaq 0x3b3fc(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x2cc4d
cmpq $0x0, -0x28(%rbp)
jne 0x2cc63
movq $0x0, -0x8(%rbp)
jmp 0x2cf85
movq -0x28(%rbp), %rax
movq $0x0, 0x78(%rax)
movq -0x28(%rbp), %rax
leaq 0x5c566(%rip), %rcx     # 0x891e0
movq %rcx, 0x50(%rax)
movq -0x28(%rbp), %rax
leaq 0x5c59f(%rip), %rcx     # 0x89228
movq %rcx, 0x58(%rax)
movq -0x28(%rbp), %rax
leaq 0x5c5d8(%rip), %rcx     # 0x89270
movq %rcx, 0x60(%rax)
movq -0x28(%rbp), %rax
leaq 0x5c611(%rip), %rcx     # 0x892b8
movq %rcx, 0x68(%rax)
movq -0x28(%rbp), %rax
leaq 0x5c64a(%rip), %rcx     # 0x89300
movq %rcx, 0x70(%rax)
movq -0x28(%rbp), %rax
movb 0x82(%rax), %cl
andb $-0x2, %cl
orb $0x0, %cl
movb %cl, 0x82(%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0x80(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x88(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x90(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x98(%rax)
movq -0x20(%rbp), %rdi
leaq 0x27b(%rip), %rsi       # 0x2cf90
callq 0x9cc0
cmpq $0x0, -0x18(%rbp)
jne 0x2ce7c
movq -0x20(%rbp), %rdi
movl $0x64, %esi
callq 0x3e9c0
movq -0x20(%rbp), %rdi
movl $0x2, %esi
movl $0x1, %edx
callq 0x2d520
movq -0x20(%rbp), %rdi
movl $0xc8, %esi
movl $0x12c, %edx            # imm = 0x12C
callq 0x8180
movq -0x20(%rbp), %rdi
movl $0x3, %esi
callq 0x2d560
movq -0x20(%rbp), %rdi
movl $0x2, %esi
callq 0x2d590
callq 0x4cfc0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x2ce50
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x258(%rax), %rdx
xorl %esi, %esi
callq 0x2d5c0
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x260(%rax), %rdx
movl $0x1, %esi
callq 0x2d5c0
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x268(%rax), %rdx
movl $0x2, %esi
callq 0x2d5c0
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x270(%rax), %rdx
movl $0x4, %esi
callq 0x2d5c0
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x278(%rax), %rdx
movl $0x5, %esi
callq 0x2d5c0
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x280(%rax), %rdx
movl $0x6, %esi
callq 0x2d5c0
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x288(%rax), %rdx
movl $0x7, %esi
callq 0x2d5c0
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x290(%rax), %rdx
movl $0x8, %esi
callq 0x2d5c0
jmp 0x2ce77
movq -0x20(%rbp), %rdi
xorl %esi, %esi
leaq 0x5c2f3(%rip), %rdx     # 0x89150
callq 0x2d5c0
movq -0x20(%rbp), %rdi
movl $0x1, %esi
leaq 0x5c206(%rip), %rdx     # 0x89078
callq 0x2d5c0
jmp 0x2cf7d
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2d760
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x2cf06
movq $0x0, -0x48(%rbp)
movq -0x40(%rbp), %rdi
callq 0x2d810
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x2ceca
movq -0x50(%rbp), %rdi
callq 0x3a7a0
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rdi
callq 0x2db60
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq %rax, %rdx
callq 0x2d8a0
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x2d760
movq %rax, -0x40(%rbp)
jmp 0x2ce9a
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x50(%rax), %rdx
movl $0x4, %esi
callq 0x2d5c0
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x58(%rax), %rdx
movl $0x5, %esi
callq 0x2d5c0
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x60(%rax), %rdx
movl $0x6, %esi
callq 0x2d5c0
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x60(%rax), %rdx
movl $0x7, %esi
callq 0x2d5c0
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rdx
movl $0x8, %esi
callq 0x2d5c0
movq -0x20(%rbp), %rdi
callq 0x9250
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nop