// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_label.c
// Function: lv_label_create
lv_obj_t * lv_label_create(lv_obj_t * par, const lv_obj_t * copy)
{
    LV_LOG_TRACE("label create started");

    /*Create a basic object*/
    lv_obj_t * new_label = lv_obj_create(par, copy);
    LV_ASSERT_MEM(new_label);
    if(new_label == NULL) return NULL;

    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_label);

    /*Extend the basic object to a label object*/
    lv_obj_allocate_ext_attr(new_label, sizeof(lv_label_ext_t));

    lv_label_ext_t * ext = lv_obj_get_ext_attr(new_label);
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;

    ext->text       = NULL;
    ext->static_txt = 0;
    ext->recolor    = 0;
    ext->body_draw  = 0;
    ext->align      = LV_LABEL_ALIGN_AUTO;
    ext->dot_end    = LV_LABEL_DOT_END_INV;
    ext->long_mode  = LV_LABEL_LONG_EXPAND;
#if LV_USE_ANIMATION
    ext->anim_speed = LV_LABEL_DEF_SCROLL_SPEED;
#endif
    ext->offset.x = 0;
    ext->offset.y = 0;

#if LV_LABEL_LONG_TXT_HINT
    ext->hint.line_start = -1;
    ext->hint.coord_y    = 0;
    ext->hint.y          = 0;
#endif

#if LV_LABEL_TEXT_SEL
    ext->txt_sel_start = LV_DRAW_LABEL_NO_TXT_SEL;
    ext->txt_sel_end   = LV_DRAW_LABEL_NO_TXT_SEL;
#endif
    ext->dot.tmp_ptr   = NULL;
    ext->dot_tmp_alloc = 0;

    lv_obj_set_design_cb(new_label, lv_label_design);
    lv_obj_set_signal_cb(new_label, lv_label_signal);

    /*Init the new label*/
    if(copy == NULL) {
        lv_obj_set_click(new_label, false);
        lv_label_set_long_mode(new_label, LV_LABEL_LONG_EXPAND);
        lv_label_set_text(new_label, "Text");
        lv_label_set_style(new_label, LV_LABEL_STYLE_MAIN, NULL); /*Inherit parent's style*/
    }
    /*Copy 'copy' if not NULL*/
    else {
        lv_label_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
        lv_label_set_long_mode(new_label, lv_label_get_long_mode(copy));
        lv_label_set_recolor(new_label, lv_label_get_recolor(copy));
        lv_label_set_body_draw(new_label, lv_label_get_body_draw(copy));
        lv_label_set_align(new_label, lv_label_get_align(copy));
        if(copy_ext->static_txt == 0)
            lv_label_set_text(new_label, lv_label_get_text(copy));
        else
            lv_label_set_static_text(new_label, lv_label_get_text(copy));

        /*In DOT mode save the text byte-to-byte because a '\0' can be in the middle*/
        if(copy_ext->long_mode == LV_LABEL_LONG_DOT) {
            ext->text = lv_mem_realloc(ext->text, lv_mem_get_size(copy_ext->text));
            LV_ASSERT_MEM(ext->text);
            if(ext->text == NULL) return NULL;
            memcpy(ext->text, copy_ext->text, lv_mem_get_size(copy_ext->text));
        }

        if(copy_ext->dot_tmp_alloc && copy_ext->dot.tmp_ptr) {
            uint16_t len = (uint16_t    )strlen(copy_ext->dot.tmp_ptr);
            lv_label_set_dot_tmp(new_label, ext->dot.tmp_ptr, len);
        } else {
            memcpy(ext->dot.tmp, copy_ext->dot.tmp, sizeof(ext->dot.tmp));
        }
        ext->dot_tmp_alloc = copy_ext->dot_tmp_alloc;
        ext->dot_end       = copy_ext->dot_end;

        /*Refresh the style with new signal function*/
        lv_obj_refresh_style(new_label);
    }

    LV_LOG_INFO("label created");

    return new_label;
}

// 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 0x66b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x29863
movq -0x20(%rbp), %rsi
leaq 0x3e7e8(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x29861
cmpq $0x0, -0x20(%rbp)
jne 0x29877
movq $0x0, -0x8(%rbp)
jmp 0x29c37
cmpq $0x0, 0x5fc01(%rip)     # 0x89480
jne 0x29891
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, 0x5fbef(%rip)     # 0x89480
movq -0x20(%rbp), %rdi
movl $0x20, %esi
callq 0x9d60
movq -0x20(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x298cb
movq -0x28(%rbp), %rsi
leaq 0x3e780(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x298c9
cmpq $0x0, -0x28(%rbp)
jne 0x298df
movq $0x0, -0x8(%rbp)
jmp 0x29c37
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
movq -0x28(%rbp), %rax
movw 0x18(%rax), %cx
andw $-0x9, %cx
orw $0x0, %cx
movw %cx, 0x18(%rax)
movq -0x28(%rbp), %rax
movw 0x18(%rax), %cx
andw $-0x41, %cx
orw $0x0, %cx
movw %cx, 0x18(%rax)
movq -0x28(%rbp), %rax
movw 0x18(%rax), %cx
andw $0xfeff, %cx            # imm = 0xFEFF
orw $0x0, %cx
movw %cx, 0x18(%rax)
movq -0x28(%rbp), %rax
movw 0x18(%rax), %cx
andw $-0x31, %cx
orw $0x30, %cx
movw %cx, 0x18(%rax)
movq -0x28(%rbp), %rax
movw $0xffff, 0x10(%rax)     # imm = 0xFFFF
movq -0x28(%rbp), %rax
movw 0x18(%rax), %cx
andw $-0x8, %cx
orw $0x0, %cx
movw %cx, 0x18(%rax)
movq -0x28(%rbp), %rax
movw $0x19, 0x16(%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0x12(%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0x14(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x28(%rbp), %rax
movw 0x18(%rax), %cx
andw $0xfdff, %cx            # imm = 0xFDFF
orw $0x0, %cx
movw %cx, 0x18(%rax)
movq -0x20(%rbp), %rdi
leaq 0x2ad(%rip), %rsi       # 0x29c50
callq 0x9d10
movq -0x20(%rbp), %rdi
leaq 0x85d(%rip), %rsi       # 0x2a210
callq 0x9cc0
cmpq $0x0, -0x18(%rbp)
jne 0x299f9
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x94b0
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x2a4f0
movq -0x20(%rbp), %rdi
leaq 0x3ec01(%rip), %rsi     # 0x685e1
callq 0x2a630
movq -0x20(%rbp), %rdi
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2a7f0
jmp 0x29c2f
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2a820
movq -0x58(%rbp), %rdi
movzbl %al, %esi
callq 0x2a4f0
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2a920
movq -0x50(%rbp), %rdi
movzbl %al, %esi
andl $0x1, %esi
callq 0x2a870
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2aa50
movq -0x48(%rbp), %rdi
movzbl %al, %esi
andl $0x1, %esi
callq 0x2a990
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2ab50
movq -0x40(%rbp), %rdi
movzbl %al, %esi
callq 0x2aac0
movq -0x30(%rbp), %rax
movw 0x18(%rax), %ax
shrw $0x3, %ax
andw $0x1, %ax
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x29ab7
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2abc0
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x2a630
jmp 0x29ad4
movq -0x20(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2abc0
movq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0x2ac10
movq -0x30(%rbp), %rax
movw 0x18(%rax), %ax
andw $0x7, %ax
movzbl %al, %eax
cmpl $0x2, %eax
jne 0x29b89
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x45090
movq -0x70(%rbp), %rdi
movl %eax, %eax
movl %eax, %esi
callq 0x44f70
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rdi
callq 0xd120
testb $0x1, %al
jne 0x29b3f
movq -0x28(%rbp), %rax
movq (%rax), %rsi
leaq 0x3e50c(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x29b3d
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x29b56
movq $0x0, -0x8(%rbp)
jmp 0x29c37
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x45090
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rsi
movl %eax, %eax
movl %eax, %edx
callq 0x20e0
movq -0x30(%rbp), %rax
movw 0x18(%rax), %ax
shrw $0x9, %ax
andw $0x1, %ax
movzbl %al, %eax
cmpl $0x0, %eax
je 0x29bd4
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x29bd4
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2060
movw %ax, -0x32(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rsi
movzwl -0x32(%rbp), %edx
callq 0x2ace0
jmp 0x29be2
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl %ecx, 0x8(%rax)
movq -0x30(%rbp), %rax
movw 0x18(%rax), %ax
shrw $0x9, %ax
andw $0x1, %ax
movb %al, %cl
movq -0x28(%rbp), %rax
movzbl %cl, %ecx
movw %cx, %dx
movw 0x18(%rax), %cx
andw $0x1, %dx
shlw $0x9, %dx
andw $0xfdff, %cx            # imm = 0xFDFF
orw %dx, %cx
movw %cx, 0x18(%rax)
movq -0x30(%rbp), %rax
movw 0x10(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x10(%rax)
movq -0x20(%rbp), %rdi
callq 0x9250
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)