// File: /workspace/github_c_makefile_star2_O1/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 0x80d4
testb %al, %al
je 0x1c195
movq %rbx, %rdi
callq 0x6ad8
movq %rax, %r15
incw 0x80(%rax)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x130d4
movq %rax, %r14
cmpq $0x0, 0x443fc(%rip)     # 0x603c0
jne 0x1bfd5
movq %r14, %rdi
callq 0x6a6c
movq %rax, 0x443eb(%rip)     # 0x603c0
movq 0x50(%r15), %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x1353c
movq 0x58(%r15), %rdx
movq %r14, %rdi
movl $0x1, %esi
callq 0x1353c
movq 0x60(%r15), %rdx
movq %r14, %rdi
movl $0x2, %esi
callq 0x1353c
movq 0x68(%r15), %rdx
movq %r14, %rdi
movl $0x3, %esi
callq 0x1353c
movq 0x70(%r15), %rdx
movq %r14, %rdi
movl $0x4, %esi
callq 0x1353c
movq %r14, %rdi
movl $0x1, %esi
callq 0x26592
movq %r14, %rdi
movl $0x6, %esi
callq 0x2259a
movq %r14, %rdi
movl $0x2, %esi
movl $0x2, %edx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x22602
movq %r14, %rdi
movl $0x10, %esi
callq 0x62e7
leaq 0x1b2(%rip), %rsi       # 0x1c224
movq %r14, %rdi
callq 0x645c
testq %r13, %r13
je 0x1c0c6
movq %r14, %rdi
xorl %esi, %esi
callq 0x2350c
movq %rax, %rbp
movq %rax, %rdi
movq %r13, %rsi
callq 0x23916
movq 0x78(%r15), %rsi
movq %rbp, %rdi
callq 0x5d83
movq %rbp, %rdi
xorl %esi, %esi
callq 0x5fd8
cmpq $0x0, 0x44313(%rip)     # 0x603c8
jne 0x1c0c6
movq %rbp, %rdi
callq 0x6a6c
movq %rax, 0x44302(%rip)     # 0x603c8
testq %r12, %r12
je 0x1c158
movq 0x50(%r15), %rax
movq %r12, (%rsp)
movzwl 0x1a(%rax), %r12d
movzwl 0x1c(%rax), %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x196f4
movq %rax, %r13
movq %rax, %rdi
movq (%rsp), %rsi
callq 0x19f13
movq %r13, %rdi
xorl %esi, %esi
callq 0x5fd8
movq %r13, %rdi
movl $0x4, %esi
callq 0x19e3d
movq %r14, %rdi
callq 0x4abc
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 0x56f1
cmpq $0x0, 0x44289(%rip)     # 0x603d0
jne 0x1c158
movq %r13, %rdi
callq 0x6a6c
movq %rax, 0x44278(%rip)     # 0x603d0
movq %rbx, %rdi
callq 0x4ea3
cmpw $0x1, 0x80(%r15)
jne 0x1c183
movq %rax, %rdi
callq 0x2a39
cmpq %rbx, %rax
jne 0x1c183
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1c404
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x22f98(%rip), %rdi     # 0x3f134
movq %rbx, %rsi
callq 0x829e
jmp 0x1c1a4