// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_ddlist.c
// Function: lv_ddlist_create
lv_obj_t * lv_ddlist_create(lv_obj_t * par, const lv_obj_t * copy)
{
    LV_LOG_TRACE("drop down list create started");

    /*Create the ancestor drop down list*/
    lv_obj_t * new_ddlist = lv_page_create(par, copy);
    LV_ASSERT_MEM(new_ddlist);
    if(new_ddlist == NULL) return NULL;

    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_ddlist);
    if(ancestor_scrl_signal == NULL) ancestor_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrl(new_ddlist));
    if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_cb(new_ddlist);

    /*Allocate the drop down list type specific extended data*/
    lv_ddlist_ext_t * ext = lv_obj_allocate_ext_attr(new_ddlist, sizeof(lv_ddlist_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;

    /*Initialize the allocated 'ext' */
    ext->label          = NULL;
    ext->opened         = 0;
    ext->fix_height     = 0;
    ext->sel_opt_id     = 0;
    ext->sel_opt_id_ori = 0;
    ext->option_cnt     = 0;
    ext->sel_style      = &lv_style_plain_color;
    ext->draw_arrow     = 0; /*Do not draw arrow by default*/
    ext->stay_open      = 0;

    /*The signal and design functions are not copied so set them here*/
    lv_obj_set_signal_cb(new_ddlist, lv_ddlist_signal);
    lv_obj_set_signal_cb(lv_page_get_scrl(new_ddlist), lv_ddlist_scrl_signal);
    lv_obj_set_design_cb(new_ddlist, lv_ddlist_design);

    /*Init the new drop down list drop down list*/
    if(copy == NULL) {
        lv_page_set_anim_time(new_ddlist, LV_DDLIST_DEF_ANIM_TIME);

        lv_obj_t * scrl = lv_page_get_scrl(new_ddlist);
        lv_obj_set_drag(scrl, false);
        lv_page_set_scrl_fit2(new_ddlist, LV_FIT_FILL, LV_FIT_TIGHT);

        /*Save (a later restore) the original X coordinate because it changes as the FITs applies*/
        lv_coord_t x;
        if(lv_obj_get_base_dir(new_ddlist) == LV_BIDI_DIR_RTL) x = lv_obj_get_x(new_ddlist) + lv_obj_get_width(new_ddlist);
        else x = lv_obj_get_x(new_ddlist);

        ext->label = lv_label_create(new_ddlist, NULL);
        lv_cont_set_fit2(new_ddlist, LV_FIT_TIGHT, LV_FIT_NONE);
        lv_page_set_sb_mode(new_ddlist, LV_SB_MODE_HIDE);
        lv_page_set_style(new_ddlist, LV_PAGE_STYLE_SCRL, &lv_style_transp_tight);

        lv_ddlist_set_options(new_ddlist, "Option 1\nOption 2\nOption 3");

        /*Restore the original X coordinate*/
        if(lv_obj_get_base_dir(new_ddlist) == LV_BIDI_DIR_RTL) lv_obj_set_x(new_ddlist, x - lv_obj_get_width(new_ddlist));
        else lv_obj_set_x(new_ddlist, x);

        /*Set the default styles*/
        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            lv_ddlist_set_style(new_ddlist, LV_DDLIST_STYLE_BG, th->style.ddlist.bg);
            lv_ddlist_set_style(new_ddlist, LV_DDLIST_STYLE_SEL, th->style.ddlist.sel);
            lv_ddlist_set_style(new_ddlist, LV_DDLIST_STYLE_SB, th->style.ddlist.sb);
        } else {
            lv_ddlist_set_style(new_ddlist, LV_DDLIST_STYLE_BG, &lv_style_pretty);
            lv_ddlist_set_style(new_ddlist, LV_DDLIST_STYLE_SEL, &lv_style_plain_color);
            lv_ddlist_set_style(new_ddlist, LV_DDLIST_STYLE_SB, &lv_style_pretty_color);
        }


    }
    /*Copy an existing drop down list*/
    else {
        lv_ddlist_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
        ext->label                 = lv_label_create(new_ddlist, copy_ext->label);
        lv_label_set_text(ext->label, lv_label_get_text(copy_ext->label));
        ext->sel_opt_id     = copy_ext->sel_opt_id;
        ext->sel_opt_id_ori = copy_ext->sel_opt_id;
        ext->fix_height     = copy_ext->fix_height;
        ext->option_cnt     = copy_ext->option_cnt;
        ext->sel_style      = copy_ext->sel_style;
        ext->draw_arrow     = copy_ext->draw_arrow;
        ext->stay_open      = copy_ext->stay_open;

        lv_ddlist_set_style(new_ddlist, LV_DDLIST_STYLE_BG, lv_ddlist_get_style(copy, LV_DDLIST_STYLE_BG));
        lv_ddlist_set_style(new_ddlist, LV_DDLIST_STYLE_SB, lv_ddlist_get_style(copy, LV_DDLIST_STYLE_SB));
        lv_ddlist_set_style(new_ddlist, LV_DDLIST_STYLE_SEL, lv_ddlist_get_style(copy, LV_DDLIST_STYLE_SEL));

    }

    LV_LOG_INFO("drop down list created");

    return new_ddlist;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %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 0x12c13
movq -0x20(%rbp), %rsi
leaq 0x55438(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x12c11
cmpq $0x0, -0x20(%rbp)
jne 0x12c27
movq $0x0, -0x8(%rbp)
jmp 0x13094
cmpq $0x0, 0x76771(%rip)     # 0x893a0
jne 0x12c41
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, 0x7675f(%rip)     # 0x893a0
cmpq $0x0, 0x7675f(%rip)     # 0x893a8
jne 0x12c63
movq -0x20(%rbp), %rdi
callq 0x3e970
movq %rax, %rdi
callq 0xa830
movq %rax, 0x76745(%rip)     # 0x893a8
cmpq $0x0, 0x76745(%rip)     # 0x893b0
jne 0x12c7d
movq -0x20(%rbp), %rdi
callq 0xa870
movq %rax, 0x76733(%rip)     # 0x893b0
movq -0x20(%rbp), %rdi
movl $0x70, %esi
callq 0x9d60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x12cae
movq -0x28(%rbp), %rsi
leaq 0x5539d(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x12cac
cmpq $0x0, -0x28(%rbp)
jne 0x12cc2
movq $0x0, -0x8(%rbp)
jmp 0x13094
movq -0x28(%rbp), %rax
movq $0x0, 0x50(%rax)
movq -0x28(%rbp), %rax
movb 0x66(%rax), %cl
andb $-0x2, %cl
orb $0x0, %cl
movb %cl, 0x66(%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0x68(%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0x62(%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0x64(%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0x60(%rax)
movq -0x28(%rbp), %rax
leaq 0x7631f(%rip), %rcx     # 0x89030
movq %rcx, 0x58(%rax)
movq -0x28(%rbp), %rax
movb 0x66(%rax), %cl
andb $-0x5, %cl
orb $0x0, %cl
movb %cl, 0x66(%rax)
movq -0x28(%rbp), %rax
movb 0x66(%rax), %cl
andb $-0x9, %cl
orb $0x0, %cl
movb %cl, 0x66(%rax)
movq -0x20(%rbp), %rdi
leaq 0x370(%rip), %rsi       # 0x130b0
callq 0x9cc0
movq -0x20(%rbp), %rdi
callq 0x3e970
movq %rax, %rdi
leaq 0x778(%rip), %rsi       # 0x134d0
callq 0x9cc0
movq -0x20(%rbp), %rdi
leaq 0x888(%rip), %rsi       # 0x135f0
callq 0x9d10
cmpq $0x0, -0x18(%rbp)
jne 0x12f3b
movq -0x20(%rbp), %rdi
movl $0xc8, %esi
callq 0x3e9c0
movq -0x20(%rbp), %rdi
callq 0x3e970
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x95a0
movq -0x20(%rbp), %rdi
movl $0x3, %esi
movl $0x1, %edx
callq 0x13bb0
movq -0x20(%rbp), %rdi
callq 0x7180
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x12de9
movq -0x20(%rbp), %rdi
callq 0x7350
cwtl
movl %eax, -0x4c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x8310
movw %ax, %cx
movl -0x4c(%rbp), %eax
movswl %cx, %ecx
addl %ecx, %eax
movw %ax, -0x32(%rbp)
jmp 0x12df6
movq -0x20(%rbp), %rdi
callq 0x7350
movw %ax, -0x32(%rbp)
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x29820
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x20(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x13bf0
movq -0x20(%rbp), %rdi
movl $0x4, %esi
callq 0x3dec0
movq -0x20(%rbp), %rdi
movl $0x1, %esi
leaq 0x7635c(%rip), %rdx     # 0x89198
callq 0x3dff0
movq -0x20(%rbp), %rdi
leaq 0x5533f(%rip), %rsi     # 0x6818b
callq 0x13c30
movq -0x20(%rbp), %rdi
callq 0x7180
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x12e93
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movswl -0x32(%rbp), %eax
movl %eax, -0x50(%rbp)
movq -0x20(%rbp), %rdi
callq 0x8310
movq -0x58(%rbp), %rdi
movw %ax, %cx
movl -0x50(%rbp), %eax
movswl %cx, %ecx
subl %ecx, %eax
movswl %ax, %esi
callq 0x80b0
jmp 0x12ea0
movq -0x20(%rbp), %rdi
movswl -0x32(%rbp), %esi
callq 0x80b0
callq 0x4cfc0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x12efa
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rax
movq 0x298(%rax), %rdx
xorl %esi, %esi
callq 0x13dc0
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rax
movq 0x2a0(%rax), %rdx
movl $0x1, %esi
callq 0x13dc0
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rax
movq 0x2a8(%rax), %rdx
movl $0x2, %esi
callq 0x13dc0
jmp 0x12f36
movq -0x20(%rbp), %rdi
xorl %esi, %esi
leaq 0x76171(%rip), %rdx     # 0x89078
callq 0x13dc0
movq -0x20(%rbp), %rdi
movl $0x1, %esi
leaq 0x76114(%rip), %rdx     # 0x89030
callq 0x13dc0
movq -0x20(%rbp), %rdi
movl $0x2, %esi
leaq 0x7618f(%rip), %rdx     # 0x890c0
callq 0x13dc0
jmp 0x1308c
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
movq -0x48(%rbp), %rax
movq 0x50(%rax), %rsi
callq 0x29820
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x48(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x2abc0
movq -0x78(%rbp), %rdi
movq %rax, %rsi
callq 0x2a630
movq -0x48(%rbp), %rax
movw 0x62(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x62(%rax)
movq -0x48(%rbp), %rax
movw 0x62(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x64(%rax)
movq -0x48(%rbp), %rax
movw 0x68(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x68(%rax)
movq -0x48(%rbp), %rax
movw 0x60(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x60(%rax)
movq -0x48(%rbp), %rax
movq 0x58(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x48(%rbp), %rax
movb 0x66(%rax), %dl
shrb $0x2, %dl
andb $0x1, %dl
movq -0x28(%rbp), %rax
movb 0x66(%rax), %cl
andb $0x1, %dl
shlb $0x2, %dl
andb $-0x5, %cl
orb %dl, %cl
movb %cl, 0x66(%rax)
movq -0x48(%rbp), %rax
movb 0x66(%rax), %dl
shrb $0x3, %dl
andb $0x1, %dl
movq -0x28(%rbp), %rax
movb 0x66(%rax), %cl
andb $0x1, %dl
shlb $0x3, %dl
andb $-0x9, %cl
orb %dl, %cl
movb %cl, 0x66(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x13e80
movq -0x70(%rbp), %rdi
movq %rax, %rdx
xorl %esi, %esi
callq 0x13dc0
movq -0x20(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
movl $0x2, %esi
callq 0x13e80
movq -0x68(%rbp), %rdi
movq %rax, %rdx
movl $0x2, %esi
callq 0x13dc0
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x13e80
movq -0x60(%rbp), %rdi
movq %rax, %rdx
movl $0x1, %esi
callq 0x13dc0
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)