// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_list.c
// Function: lv_list_add_btn
lv_obj_t * lv_list_add_btn(lv_obj_t * list, const void * img_src, const char * txt)
{
    LV_ASSERT_OBJ(list, LV_OBJX_NAME);

    lv_list_ext_t * ext = lv_obj_get_ext_attr(list);
    ext->size++;
    /*Create a list element with the image an the text*/
    lv_obj_t * liste;
    liste = lv_btn_create(list, NULL);

    /*Save the original signal function because it will be required in `lv_list_btn_signal`*/
    if(ancestor_btn_signal == NULL) ancestor_btn_signal = lv_obj_get_signal_cb(liste);

    /*Set the default styles*/
    lv_btn_set_style(liste, LV_BTN_STYLE_REL, ext->styles_btn[LV_BTN_STATE_REL]);
    lv_btn_set_style(liste, LV_BTN_STYLE_PR, ext->styles_btn[LV_BTN_STATE_PR]);
    lv_btn_set_style(liste, LV_BTN_STYLE_TGL_REL, ext->styles_btn[LV_BTN_STATE_TGL_REL]);
    lv_btn_set_style(liste, LV_BTN_STYLE_TGL_PR, ext->styles_btn[LV_BTN_STATE_TGL_PR]);
    lv_btn_set_style(liste, LV_BTN_STYLE_INA, ext->styles_btn[LV_BTN_STATE_INA]);

    lv_page_glue_obj(liste, true);
    lv_btn_set_layout(liste, LV_LAYOUT_ROW_M);
    lv_btn_set_fit2(liste, LV_FIT_FLOOD, LV_FIT_TIGHT);
    lv_obj_set_protect(liste, LV_PROTECT_PRESS_LOST);
    lv_obj_set_signal_cb(liste, lv_list_btn_signal);

#if LV_USE_IMG != 0
    lv_obj_t * img = NULL;
    if(img_src) {
        img = lv_img_create(liste, NULL);
        lv_img_set_src(img, img_src);
        lv_obj_set_style(img, ext->style_img);
        lv_obj_set_click(img, false);
        if(img_signal == NULL) img_signal = lv_obj_get_signal_cb(img);
    }
#endif
    if(txt != NULL) {
        lv_coord_t btn_hor_pad = ext->styles_btn[LV_BTN_STYLE_REL]->body.padding.left -
                                 ext->styles_btn[LV_BTN_STYLE_REL]->body.padding.right;
        lv_obj_t * label = lv_label_create(liste, NULL);
        lv_label_set_text(label, txt);
        lv_obj_set_click(label, false);
        lv_label_set_long_mode(label, LV_LABEL_LONG_SROLL_CIRC);
        if(lv_obj_get_base_dir(liste) == LV_BIDI_DIR_RTL) lv_obj_set_width(label, label->coords.x2 - liste->coords.x1 - btn_hor_pad);
        else  lv_obj_set_width(label, liste->coords.x2 - label->coords.x1 - btn_hor_pad);
        if(label_signal == NULL) label_signal = lv_obj_get_signal_cb(label);
    }
#if LV_USE_GROUP
    /* If this is the first item to be added to the list and the list is
     * focused, select it */
    {
        lv_group_t * g = lv_obj_get_group(list);
        if(ext->size == 1 && lv_group_get_focused(g) == list) {
            lv_list_set_btn_selected(list, liste);
        }
    }
#endif

    return liste;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
callq 0x7994
testb %al, %al
je 0x1abad
movq %rbx, %rdi
callq 0x6747
movq %rax, %r15
incw 0x80(%rax)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x122f0
movq %rax, %r14
cmpq $0x0, 0x439c0(%rip)     # 0x5e3c0
jne 0x1aa11
movq %r14, %rdi
callq 0x66db
movq %rax, 0x439af(%rip)     # 0x5e3c0
movq 0x50(%r15), %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x126f8
movq 0x58(%r15), %rdx
pushq $0x1
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
callq 0x126f8
movq 0x60(%r15), %rdx
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x126f8
movq 0x68(%r15), %rdx
pushq $0x3
popq %rsi
movq %r14, %rdi
callq 0x126f8
movq 0x70(%r15), %rdx
pushq $0x4
popq %rsi
movq %r14, %rdi
callq 0x126f8
movq %r14, %rdi
movl %ebp, %esi
callq 0x248df
pushq $0x6
popq %rsi
movq %r14, %rdi
callq 0x20bca
movq %r14, %rdi
callq 0x1b5c2
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0x5f71
leaq 0x1af(%rip), %rsi       # 0x1ac3b
movq %r14, %rdi
callq 0x60e6
testq %r13, %r13
je 0x1aae0
movq %r14, %rdi
xorl %esi, %esi
callq 0x21a28
movq %rax, %rbp
movq %rax, %rdi
movq %r13, %rsi
callq 0x21e19
movq 0x78(%r15), %rsi
movq %rbp, %rdi
callq 0x5a3d
movq %rbp, %rdi
xorl %esi, %esi
callq 0x5c6f
cmpq $0x0, 0x438f9(%rip)     # 0x5e3c8
jne 0x1aae0
movq %rbp, %rdi
callq 0x66db
movq %rax, 0x438e8(%rip)     # 0x5e3c8
testq %r12, %r12
je 0x1ab70
movq 0x50(%r15), %rax
movq %r12, (%rsp)
movzwl 0x1a(%rax), %r12d
movzwl 0x1c(%rax), %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x182f0
movq %rax, %r13
movq %rax, %rdi
movq (%rsp), %rsi
callq 0x18a9a
movq %r13, %rdi
xorl %esi, %esi
callq 0x5c6f
pushq $0x4
popq %rsi
movq %r13, %rdi
callq 0x189c5
movq %r14, %rdi
callq 0x47b9
cmpb $0x1, %al
movq %r14, %rax
cmoveq %r13, %rax
movq %r14, %rcx
cmovneq %r13, %rcx
addw 0x24(%rax), %bp
addw 0x20(%rcx), %r12w
subl %r12d, %ebp
movswl %bp, %esi
movq %r13, %rdi
callq 0x53a8
cmpq $0x0, 0x43871(%rip)     # 0x5e3d0
jne 0x1ab70
movq %r13, %rdi
callq 0x66db
movq %rax, 0x43860(%rip)     # 0x5e3d0
movq %rbx, %rdi
callq 0x4b8e
cmpw $0x1, 0x80(%r15)
jne 0x1ab9b
movq %rax, %rdi
callq 0x29b8
cmpq %rbx, %rax
jne 0x1ab9b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1ae15
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x20590(%rip), %rdi     # 0x3b144
movq %rbx, %rsi
callq 0x7b01
jmp 0x1abbc