// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
callq 0x455f
movq %rax, %rbx
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x19839
testq %rbx, %rbx
je 0x1990e
cmpq $0x0, 0x46c85(%rip)     # 0x603b0
jne 0x1973c
movq %rbx, %rdi
callq 0x6a6c
movq %rax, 0x46c74(%rip)     # 0x603b0
movq %rbx, %rdi
movl $0x20, %esi
callq 0x64bc
movq %rbx, %rdi
callq 0x6ad8
movq %rax, %r14
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x1984a
testq %r14, %r14
je 0x1990e
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movl 0x18(%r14), %eax
orl $0x30, %eax
movw $0xffff, 0x10(%r14)     # imm = 0xFFFF
movw $0x19, 0x16(%r14)
movl $0x0, 0x12(%r14)
andl $0xfcb0, %eax           # imm = 0xFCB0
movw %ax, 0x18(%r14)
leaq 0x1c7(%rip), %rsi       # 0x19969
movq %rbx, %rdi
callq 0x648c
leaq 0x562(%rip), %rsi       # 0x19d13
movq %rbx, %rdi
callq 0x645c
testq %r12, %r12
je 0x1985b
movq %r12, %rdi
callq 0x6ad8
movq %rax, %r15
movq %r12, %rdi
callq 0x1a045
movzbl %al, %esi
movq %rbx, %rdi
callq 0x19e3d
movq %r12, %rdi
callq 0x1a0d0
movzbl %al, %esi
movq %rbx, %rdi
callq 0x1a072
movq %r12, %rdi
callq 0x1a169
movzbl %al, %esi
movq %rbx, %rdi
callq 0x1a100
movq %r12, %rdi
callq 0x1a1ff
movzbl %al, %esi
movq %rbx, %rdi
callq 0x1a196
movzwl 0x18(%r15), %ebp
movq %r12, %rdi
callq 0x1a239
movq %rbx, %rdi
movq %rax, %rsi
testb $0x8, %bpl
jne 0x1988d
callq 0x19f13
jmp 0x19892
leaq 0x25800(%rip), %rdi     # 0x3f040
movq %rbx, %rsi
callq 0x829e
jmp 0x19848
leaq 0x257ef(%rip), %rdi     # 0x3f040
movq %r14, %rsi
callq 0x829e
jmp 0x19859
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5fd8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x19e3d
leaq 0x25ebe(%rip), %rsi     # 0x3f734
movq %rbx, %rdi
callq 0x19f13
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5d83
jmp 0x19910
callq 0x1a264
movzwl 0x18(%r15), %eax
andl $0x7, %eax
cmpw $0x2, %ax
jne 0x198e8
movq (%r14), %r12
movq (%r15), %rdi
callq 0x29a7b
movl %eax, %esi
movq %r12, %rdi
callq 0x299f8
movq %rax, (%r14)
movq %rax, %rdi
callq 0x80d4
movq (%r14), %r12
testb %al, %al
je 0x19958
testq %r12, %r12
je 0x1990e
movq (%r15), %r13
movq %r13, %rdi
callq 0x29a7b
movl %eax, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x20f0
testb $0x2, 0x19(%r15)
je 0x19922
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x19922
callq 0x2070
movq 0x8(%r14), %rsi
movzwl %ax, %edx
movq %rbx, %rdi
callq 0x1a2e5
jmp 0x1992a
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%r15), %eax
movl %eax, 0x8(%r14)
movzwl 0x18(%r15), %eax
andl $0x200, %eax            # imm = 0x200
movl $0xfffffdff, %ecx       # imm = 0xFFFFFDFF
andl 0x18(%r14), %ecx
orl %eax, %ecx
movw %cx, 0x18(%r14)
movzwl 0x10(%r15), %eax
movw %ax, 0x10(%r14)
movq %rbx, %rdi
callq 0x5e38
jmp 0x19910
leaq 0x256e1(%rip), %rdi     # 0x3f040
movq %r12, %rsi
callq 0x829e
jmp 0x19967