// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_ta.c
// Function: lv_ta_create
lv_obj_t * lv_ta_create(lv_obj_t * par, const lv_obj_t * copy)
{
    LV_LOG_TRACE("text area create started");

    /*Create the ancestor object*/
    lv_obj_t * new_ta = lv_page_create(par, copy);
    LV_ASSERT_MEM(new_ta);
    if(new_ta == NULL) return NULL;

    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_ta);
    if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_cb(new_ta);
    if(scrl_signal == NULL) scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrl(new_ta));
    if(scrl_design == NULL) scrl_design = lv_obj_get_design_cb(lv_page_get_scrl(new_ta));

    /*Allocate the object type specific extended data*/
    lv_ta_ext_t * ext = lv_obj_allocate_ext_attr(new_ta, sizeof(lv_ta_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;

    ext->cursor.state      = 1;
    ext->pwd_mode          = 0;
    ext->pwd_tmp           = NULL;
    ext->pwd_show_time     = LV_TA_DEF_PWD_SHOW_TIME;
    ext->accapted_chars    = NULL;
    ext->max_length        = 0;
    ext->cursor.style      = NULL;
    ext->cursor.blink_time = LV_TA_DEF_CURSOR_BLINK_TIME;
    ext->cursor.pos        = 0;
    ext->cursor.click_pos  = 1;
    ext->cursor.type       = LV_CURSOR_LINE;
    ext->cursor.valid_x    = 0;
    ext->one_line          = 0;
#if LV_LABEL_TEXT_SEL
    ext->text_sel_en = 0;
#endif
    ext->label       = NULL;
    ext->placeholder = NULL;

#if LV_USE_ANIMATION == 0
    ext->pwd_show_time     = 0;
    ext->cursor.blink_time = 0;
#endif

    lv_obj_set_signal_cb(new_ta, lv_ta_signal);
    lv_obj_set_signal_cb(lv_page_get_scrl(new_ta), lv_ta_scrollable_signal);
    lv_obj_set_design_cb(new_ta, lv_ta_design);

    /*Init the new text area object*/
    if(copy == NULL) {
        lv_page_set_scrl_fit2(new_ta, LV_FIT_FLOOD, LV_FIT_TIGHT);

        ext->label = lv_label_create(new_ta, NULL);

        lv_obj_set_design_cb(ext->page.scrl, lv_ta_scrollable_design);

        lv_label_set_long_mode(ext->label, LV_LABEL_LONG_BREAK);
        lv_label_set_text(ext->label, "Text area");
        lv_obj_set_click(ext->label, false);
        lv_obj_set_size(new_ta, LV_TA_DEF_WIDTH, LV_TA_DEF_HEIGHT);
        lv_ta_set_sb_mode(new_ta, LV_SB_MODE_DRAG);
        lv_page_set_style(new_ta, LV_PAGE_STYLE_SCRL, &lv_style_transp_tight);

        /*Set the default styles*/
        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            lv_ta_set_style(new_ta, LV_TA_STYLE_BG, th->style.ta.area);
            lv_ta_set_style(new_ta, LV_TA_STYLE_SB, th->style.ta.sb);
        } else {
            lv_ta_set_style(new_ta, LV_TA_STYLE_BG, &lv_style_pretty);
        }
    }
    /*Copy an existing object*/
    else {
        lv_obj_set_design_cb(ext->page.scrl, lv_ta_scrollable_design);
        lv_ta_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
        ext->label             = lv_label_create(new_ta, copy_ext->label);
        ext->pwd_mode          = copy_ext->pwd_mode;
        ext->accapted_chars    = copy_ext->accapted_chars;
        ext->max_length        = copy_ext->max_length;
        ext->cursor.style      = copy_ext->cursor.style;
        ext->cursor.pos        = copy_ext->cursor.pos;
        ext->cursor.valid_x    = copy_ext->cursor.valid_x;
        ext->cursor.type       = copy_ext->cursor.type;

        if(ext->pwd_mode != 0) pwd_char_hider( new_ta);

        if(copy_ext->placeholder != NULL)
            ext->placeholder = lv_label_create(new_ta, copy_ext->placeholder);
        else
            ext->placeholder = NULL;

        if(copy_ext->pwd_tmp) {
            uint16_t len = lv_mem_get_size(copy_ext->pwd_tmp);
            ext->pwd_tmp = lv_mem_alloc(len);
            LV_ASSERT_MEM(ext->pwd_tmp);
            if(ext->pwd_tmp == NULL) return NULL;

            memcpy(ext->pwd_tmp, copy_ext->pwd_tmp, len);
        }

        if(copy_ext->one_line) lv_ta_set_one_line(new_ta, true);

        lv_ta_set_style(new_ta, LV_TA_STYLE_CURSOR, lv_ta_get_style(copy, LV_TA_STYLE_CURSOR));

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

#if LV_USE_ANIMATION
    if(ext->cursor.blink_time) {
        /*Create a cursor blinker animation*/
        lv_anim_t a;
        a.var            = new_ta;
        a.exec_cb        = (lv_anim_exec_xcb_t)cursor_blink_anim;
        a.time           = ext->cursor.blink_time;
        a.act_time       = 0;
        a.ready_cb       = NULL;
        a.start          = 1;
        a.end            = 0;
        a.repeat         = 1;
        a.repeat_pause   = 0;
        a.playback       = 1;
        a.playback_pause = 0;
        a.path_cb        = lv_anim_path_step;
        lv_anim_create(&a);
    }
#endif

    LV_LOG_INFO("text area created");

    return new_ta;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r15
callq 0x230ac
movq %rax, %rbx
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x1c50c
testq %rbx, %rbx
je 0x1c66d
cmpq $0x0, 0x420ae(%rip)     # 0x5e3e8
jne 0x1c34b
movq %rbx, %rdi
callq 0x66db
movq %rax, 0x4209d(%rip)     # 0x5e3e8
cmpq $0x0, 0x4209d(%rip)     # 0x5e3f0
jne 0x1c364
movq %rbx, %rdi
callq 0x66ff
movq %rax, 0x4208c(%rip)     # 0x5e3f0
cmpq $0x0, 0x4208c(%rip)     # 0x5e3f8
jne 0x1c385
movq %rbx, %rdi
callq 0x245d9
movq %rax, %rdi
callq 0x66db
movq %rax, 0x42073(%rip)     # 0x5e3f8
cmpq $0x0, 0x42073(%rip)     # 0x5e400
jne 0x1c3a6
movq %rbx, %rdi
callq 0x245d9
movq %rax, %rdi
callq 0x66ff
movq %rax, 0x4205a(%rip)     # 0x5e400
movq %rbx, %rdi
movl $0xa0, %esi
callq 0x6146
movq %rax, %r14
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x1c51d
testq %r14, %r14
je 0x1c66d
movb 0x90(%r14), %al
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%r14)
movl $0x5dc0000, 0x70(%r14)  # imm = 0x5DC0000
andq $0x0, 0x78(%r14)
movw $0x190, 0x84(%r14)      # imm = 0x190
andb $-0x40, %al
orb $0x31, %al
movb %al, 0x90(%r14)
andl $0x0, 0x80(%r14)
andb $-0x4, 0x98(%r14)
movups %xmm0, 0x50(%r14)
leaq 0x2d2(%rip), %rsi       # 0x1c6ee
movq %rbx, %rdi
callq 0x60e6
movq %rbx, %rdi
callq 0x245d9
leaq 0x677(%rip), %rsi       # 0x1caaa
movq %rax, %rdi
callq 0x60e6
leaq 0x7a7(%rip), %rsi       # 0x1cbe9
movq %rbx, %rdi
callq 0x6116
testq %r15, %r15
je 0x1c52e
movq 0x8(%r14), %rdi
leaq 0x7db(%rip), %rsi       # 0x1cc39
callq 0x6116
movq %r15, %rdi
callq 0x6747
movq %rax, %r12
movq 0x50(%rax), %rsi
movq %rbx, %rdi
callq 0x182f0
movq %rax, 0x50(%r14)
movb 0x98(%r12), %al
andb $0x1, %al
movb 0x90(%r14), %cl
movb 0x98(%r14), %dl
andb $-0x2, %dl
orb %al, %dl
movb %dl, 0x98(%r14)
movq 0x68(%r12), %rdx
movq %rdx, 0x68(%r14)
movzwl 0x70(%r12), %edx
movw %dx, 0x70(%r14)
movq 0x78(%r12), %rdx
movq %rdx, 0x78(%r14)
movl 0x80(%r12), %edx
movl %edx, 0x80(%r14)
movb 0x90(%r12), %dl
andb $0xf, %dl
andb $-0x10, %cl
orb %dl, %cl
movb %cl, 0x90(%r14)
testb %al, %al
je 0x1c4f1
movq %rbx, %rdi
callq 0x1ceb6
movq 0x58(%r12), %rsi
testq %rsi, %rsi
je 0x1c5e6
movq %rbx, %rdi
callq 0x182f0
jmp 0x1c5e8
leaq 0x1eb2d(%rip), %rdi     # 0x3b040
movq %rbx, %rsi
callq 0x7b01
jmp 0x1c51b
leaq 0x1eb1c(%rip), %rdi     # 0x3b040
movq %r14, %rsi
callq 0x7b01
jmp 0x1c52c
pushq $0x2
popq %r15
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x1cc16
movq %rbx, %rdi
xorl %esi, %esi
callq 0x182f0
movq %rax, 0x50(%r14)
movq 0x8(%r14), %rdi
leaq 0x6de(%rip), %rsi       # 0x1cc39
callq 0x6116
movq 0x50(%r14), %rdi
movl %ebp, %esi
callq 0x189c5
movq 0x50(%r14), %rdi
leaq 0x1f38e(%rip), %rsi     # 0x3b904
callq 0x18a9a
movq 0x50(%r14), %rdi
xorl %esi, %esi
callq 0x5c6f
pushq $0x64
popq %rdx
movq %rbx, %rdi
movl $0xc8, %esi
callq 0x520e
movq %rbx, %rdi
movl %r15d, %esi
callq 0x23fed
leaq 0x41b20(%rip), %rdx     # 0x5e0c8
movq %rbx, %rdi
movl %ebp, %esi
callq 0x24089
callq 0x2be75
testq %rax, %rax
je 0x1c68f
movq %rax, %r15
movq 0x220(%rax), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1ce17
movq 0x238(%r15), %rdx
pushq $0x1
popq %rsi
movq %rbx, %rdi
jmp 0x1c69b
xorl %eax, %eax
movq %rax, 0x58(%r14)
movq 0x60(%r12), %rdi
testq %rdi, %rdi
je 0x1c633
callq 0x27b65
movzwl %ax, %r13d
movq %r13, %rdi
callq 0x279f9
movq %rax, 0x60(%r14)
movq %rax, %rdi
callq 0x7994
movq 0x60(%r14), %rsi
testb %al, %al
je 0x1c681
testq %rsi, %rsi
je 0x1c66d
movq 0x60(%r12), %rax
movq %rsi, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x20f0
testb $0x2, 0x98(%r12)
je 0x1c649
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x1cf26
pushq $0x2
popq %rbp
movq %r15, %rdi
movl %ebp, %esi
callq 0x1d069
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x1ce17
movq %rbx, %rdi
callq 0x5ae7
jmp 0x1c6a0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1e9b8(%rip), %rdi     # 0x3b040
callq 0x7b01
jmp 0x1c68d
leaq 0x41912(%rip), %rdx     # 0x5dfa8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1ce17
movzwl 0x84(%r14), %eax
testw %ax, %ax
je 0x1c66f
movq %rsp, %rdi
movq %rbx, (%rdi)
leaq 0xa32(%rip), %rcx       # 0x1d0ec
movq %rcx, 0x8(%rdi)
movw %ax, 0x28(%rdi)
andw $0x0, 0x2a(%rdi)
andq $0x0, 0x18(%rdi)
movq $0x1, 0x20(%rdi)
movb $-0x1, 0x30(%rdi)
andl $0x0, 0x2c(%rdi)
leaq 0xb2e6(%rip), %rax      # 0x279c9
movq %rax, 0x10(%rdi)
callq 0x27685
jmp 0x1c66f