// File: /workspace/github_c_makefile_star2_O3/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 0x454f
movq %rax, %rbx
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x1a011
testq %rbx, %rbx
je 0x1a0d0
cmpq $0x0, 0x464a5(%rip)     # 0x603b0
jne 0x19f1c
movq %rbx, %rdi
callq 0x6a8b
movq %rax, 0x46494(%rip)     # 0x603b0
movq %rbx, %rdi
movl $0x20, %esi
callq 0x64db
movq %rbx, %rdi
callq 0x6af7
movq %rax, %r14
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x1a022
testq %r14, %r14
je 0x1a0d0
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movabsq $0x1900000000ffff, %rax # imm = 0x1900000000FFFF
movq %rax, 0x10(%r14)
movl $0xfffffc80, %eax       # imm = 0xFFFFFC80
andl 0x18(%r14), %eax
orl $0x30, %eax
movw %ax, 0x18(%r14)
leaq 0x1cc(%rip), %rsi       # 0x1a146
movq %rbx, %rdi
callq 0x64ab
leaq 0x55f(%rip), %rsi       # 0x1a4e8
movq %rbx, %rdi
callq 0x647b
testq %r12, %r12
je 0x1a033
movq %r12, %rdi
callq 0x6af7
movq %rax, %r15
movq %r12, %rdi
callq 0x1a80c
movzbl %al, %esi
movq %rbx, %rdi
callq 0x1a602
movq %r12, %rdi
callq 0x1a897
movzbl %al, %esi
movq %rbx, %rdi
callq 0x1a839
movq %r12, %rdi
callq 0x1a930
movzbl %al, %esi
movq %rbx, %rdi
callq 0x1a8c7
movq %r12, %rdi
callq 0x1a9c6
movzbl %al, %esi
movq %rbx, %rdi
callq 0x1a95d
movzwl 0x18(%r15), %ebp
movq %r12, %rdi
callq 0x1aa00
movq %rbx, %rdi
movq %rax, %rsi
testb $0x8, %bpl
jne 0x1a062
callq 0x1a6da
jmp 0x1a067
leaq 0x250b8(%rip), %rdi     # 0x3f0d0
movq %rbx, %rsi
callq 0x8294
jmp 0x1a020
leaq 0x250a7(%rip), %rdi     # 0x3f0d0
movq %r14, %rsi
callq 0x8294
jmp 0x1a031
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5ff7
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1a602
leaq 0x2582e(%rip), %rsi     # 0x3f87c
movq %rbx, %rdi
callq 0x1a6da
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5d9f
jmp 0x1a0d2
callq 0x1aa2b
movzwl 0x18(%r15), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpw $0x2, %cx
jne 0x1a0c4
movq (%r14), %r12
movq (%r15), %rdi
callq 0x2a0fb
movl %eax, %esi
movq %r12, %rdi
callq 0x2a06f
movq %rax, (%r14)
movq %rax, %rdi
callq 0x80e4
movq (%r14), %r12
testb %al, %al
je 0x1a135
testq %r12, %r12
je 0x1a0d0
movq (%r15), %r13
movq %r13, %rdi
callq 0x2a0fb
movl %eax, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x20f0
movzwl 0x18(%r15), %eax
btl $0x9, %eax
jb 0x1a0e4
movl 0x8(%r15), %edi
jmp 0x1a103
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x1a103
callq 0x2070
movq 0x8(%r14), %rsi
movzwl %ax, %edx
movq %rbx, %rdi
callq 0x1aaac
jmp 0x1a107
movl %edi, 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 0x5e54
jmp 0x1a0d2
leaq 0x24f94(%rip), %rdi     # 0x3f0d0
movq %r12, %rsi
callq 0x8294
jmp 0x1a144