// File: /workspace/github_c_makefile_star2_O3/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 0x80e4
testb %al, %al
je 0x1c990
movq %rbx, %rdi
callq 0x6af7
movq %rax, %r15
incw 0x80(%rax)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x13104
movq %rax, %r14
cmpq $0x0, 0x43c01(%rip)     # 0x603c0
jne 0x1c7d0
movq %r14, %rdi
callq 0x6a8b
movq %rax, 0x43bf0(%rip)     # 0x603c0
movq 0x50(%r15), %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x13534
movq 0x58(%r15), %rdx
movq %r14, %rdi
movl $0x1, %esi
callq 0x13534
movq 0x60(%r15), %rdx
movq %r14, %rdi
movl $0x2, %esi
callq 0x13534
movq 0x68(%r15), %rdx
movq %r14, %rdi
movl $0x3, %esi
callq 0x13534
movq 0x70(%r15), %rdx
movq %r14, %rdi
movl $0x4, %esi
callq 0x13534
movq %r14, %rdi
movl $0x1, %esi
callq 0x26c68
movq %r14, %rdi
movl $0x6, %esi
callq 0x22d1c
movq %r14, %rdi
movl $0x2, %esi
movl $0x2, %edx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x22d84
movq %r14, %rdi
movl $0x10, %esi
callq 0x6306
leaq 0x1b2(%rip), %rsi       # 0x1ca1f
movq %r14, %rdi
callq 0x647b
testq %r13, %r13
je 0x1c8c1
movq %r14, %rdi
xorl %esi, %esi
callq 0x23c3c
movq %rax, %rbp
movq %rax, %rdi
movq %r13, %rsi
callq 0x24066
movq 0x78(%r15), %rsi
movq %rbp, %rdi
callq 0x5d9f
movq %rbp, %rdi
xorl %esi, %esi
callq 0x5ff7
cmpq $0x0, 0x43b18(%rip)     # 0x603c8
jne 0x1c8c1
movq %rbp, %rdi
callq 0x6a8b
movq %rax, 0x43b07(%rip)     # 0x603c8
testq %r12, %r12
je 0x1c953
movq 0x50(%r15), %rax
movq %r12, (%rsp)
movzwl 0x1a(%rax), %r12d
movzwl 0x1c(%rax), %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x19ed4
movq %rax, %r13
movq %rax, %rdi
movq (%rsp), %rsi
callq 0x1a6da
movq %r13, %rdi
xorl %esi, %esi
callq 0x5ff7
movq %r13, %rdi
movl $0x4, %esi
callq 0x1a602
movq %r14, %rdi
callq 0x4ab2
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 0x570d
cmpq $0x0, 0x43a8e(%rip)     # 0x603d0
jne 0x1c953
movq %r13, %rdi
callq 0x6a8b
movq %rax, 0x43a7d(%rip)     # 0x603d0
movq %rbx, %rdi
callq 0x4ed1
cmpw $0x1, 0x80(%r15)
jne 0x1c97e
movq %rax, %rdi
callq 0x2a19
cmpq %rbx, %rax
jne 0x1c97e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1cc01
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2284d(%rip), %rdi     # 0x3f1e4
movq %rbx, %rsi
callq 0x8294
jmp 0x1c99f