// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r15
callq 0x24c9c
movq %rax, %rbx
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x1dbd2
testq %rbx, %rbx
je 0x1dd55
cmpq $0x0, 0x42a03(%rip)     # 0x603e8
jne 0x1d9f6
movq %rbx, %rdi
callq 0x6a6c
movq %rax, 0x429f2(%rip)     # 0x603e8
cmpq $0x0, 0x429f2(%rip)     # 0x603f0
jne 0x1da0f
movq %rbx, %rdi
callq 0x6a90
movq %rax, 0x429e1(%rip)     # 0x603f0
cmpq $0x0, 0x429e1(%rip)     # 0x603f8
jne 0x1da30
movq %rbx, %rdi
callq 0x26288
movq %rax, %rdi
callq 0x6a6c
movq %rax, 0x429c8(%rip)     # 0x603f8
cmpq $0x0, 0x429c8(%rip)     # 0x60400
jne 0x1da51
movq %rbx, %rdi
callq 0x26288
movq %rax, %rdi
callq 0x6a90
movq %rax, 0x429af(%rip)     # 0x60400
movq %rbx, %rdi
movl $0xa0, %esi
callq 0x64bc
movq %rax, %r14
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x1dbe3
testq %r14, %r14
je 0x1dd55
movb 0x90(%r14), %al
orb $0x10, %al
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%r14)
movl $0x5dc0000, 0x70(%r14)  # imm = 0x5DC0000
movq $0x0, 0x78(%r14)
movw $0x190, 0x84(%r14)      # imm = 0x190
andb $-0x30, %al
orb $0x21, %al
movb %al, 0x90(%r14)
movl $0x0, 0x80(%r14)
andb $-0x4, 0x98(%r14)
movups %xmm0, 0x50(%r14)
leaq 0x312(%rip), %rsi       # 0x1dde1
movq %rbx, %rdi
callq 0x645c
movq %rbx, %rdi
callq 0x26288
leaq 0x6c9(%rip), %rsi       # 0x1e1af
movq %rax, %rdi
callq 0x645c
leaq 0x7f7(%rip), %rsi       # 0x1e2ec
movq %rbx, %rdi
callq 0x648c
testq %r15, %r15
je 0x1dbf4
movq 0x8(%r14), %rdi
leaq 0x804(%rip), %rsi       # 0x1e315
callq 0x648c
movq %r15, %rdi
callq 0x6ad8
movq %rax, %r12
movq 0x50(%rax), %rsi
movq %rbx, %rdi
callq 0x196f4
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)
movzwl 0x82(%r12), %edx
movw %dx, 0x82(%r14)
movzwl 0x80(%r12), %edx
movw %dx, 0x80(%r14)
movb 0x90(%r12), %dl
andb $0xf, %dl
andb $-0x10, %cl
orb %dl, %cl
movb %cl, 0x90(%r14)
testb %al, %al
je 0x1dbb7
movq %rbx, %rdi
callq 0x1e59f
movq 0x58(%r12), %rsi
testq %rsi, %rsi
je 0x1dcc9
movq %rbx, %rdi
callq 0x196f4
jmp 0x1dccb
leaq 0x21467(%rip), %rdi     # 0x3f040
movq %rbx, %rsi
callq 0x829e
jmp 0x1dbe1
leaq 0x21456(%rip), %rdi     # 0x3f040
movq %r14, %rsi
callq 0x829e
jmp 0x1dbf2
movq %rbx, %rdi
callq 0x26288
movq %rax, %rdi
movl $0x2, %esi
movl $0x2, %edx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x22602
movq %rbx, %rdi
xorl %esi, %esi
callq 0x196f4
movq %rax, 0x50(%r14)
movq 0x8(%r14), %rdi
leaq 0x6e3(%rip), %rsi       # 0x1e315
callq 0x648c
movq 0x50(%r14), %rdi
movl $0x1, %esi
callq 0x19e3d
movq 0x50(%r14), %rdi
leaq 0x21c4c(%rip), %rsi     # 0x3f89c
callq 0x19f13
movq 0x50(%r14), %rdi
xorl %esi, %esi
callq 0x5fd8
movq %rbx, %rdi
movl $0xc8, %esi
movl $0x64, %edx
callq 0x553f
movq %rbx, %rdi
movl $0x2, %esi
callq 0x25c83
leaq 0x42442(%rip), %rdx     # 0x600c8
movq %rbx, %rdi
movl $0x1, %esi
callq 0x25d1f
callq 0x2e244
testq %rax, %rax
je 0x1dd76
movq %rax, %r15
movq 0x220(%rax), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1e4f8
movq 0x238(%r15), %rdx
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x1dd82
xorl %eax, %eax
movq %rax, 0x58(%r14)
movq 0x60(%r12), %rdi
testq %rdi, %rdi
je 0x1dd16
callq 0x29a7b
movzwl %ax, %r13d
movq %r13, %rdi
callq 0x298d9
movq %rax, 0x60(%r14)
movq %rax, %rdi
callq 0x80d4
movq 0x60(%r14), %rsi
testb %al, %al
je 0x1dd68
testq %rsi, %rsi
je 0x1dd55
movq 0x60(%r12), %rax
movq %rsi, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x20f0
testb $0x2, 0x98(%r12)
je 0x1dd2e
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1e605
movq %r15, %rdi
movl $0x2, %esi
callq 0x1e77f
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x1e4f8
movq %rbx, %rdi
callq 0x5e38
jmp 0x1dd87
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x212d1(%rip), %rdi     # 0x3f040
callq 0x829e
jmp 0x1dd74
leaq 0x4222b(%rip), %rdx     # 0x5ffa8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1e4f8
movzwl 0x84(%r14), %eax
testw %ax, %ax
je 0x1dd57
leaq 0x8(%rsp), %rdi
movq %rbx, (%rdi)
leaq 0xa67(%rip), %rcx       # 0x1e80a
movq %rcx, 0x8(%rdi)
movw %ax, 0x28(%rdi)
movw $0x0, 0x2a(%rdi)
movq $0x0, 0x18(%rdi)
movq $0x1, 0x20(%rdi)
orb $0x3, 0x30(%rdi)
movl $0x0, 0x2c(%rdi)
leaq 0xbad7(%rip), %rax      # 0x298aa
movq %rax, 0x10(%rdi)
callq 0x29521
jmp 0x1dd57