// File: /workspace/github_c_makefile_star2_O3/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 0x25398
movq %rax, %rbx
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x1e3c1
testq %rbx, %rbx
je 0x1e544
cmpq $0x0, 0x421ff(%rip)     # 0x603e8
jne 0x1e1fa
movq %rbx, %rdi
callq 0x6a8b
movq %rax, 0x421ee(%rip)     # 0x603e8
cmpq $0x0, 0x421ee(%rip)     # 0x603f0
jne 0x1e213
movq %rbx, %rdi
callq 0x6aaf
movq %rax, 0x421dd(%rip)     # 0x603f0
cmpq $0x0, 0x421dd(%rip)     # 0x603f8
jne 0x1e234
movq %rbx, %rdi
callq 0x2695e
movq %rax, %rdi
callq 0x6a8b
movq %rax, 0x421c4(%rip)     # 0x603f8
cmpq $0x0, 0x421c4(%rip)     # 0x60400
jne 0x1e255
movq %rbx, %rdi
callq 0x2695e
movq %rax, %rdi
callq 0x6aaf
movq %rax, 0x421ab(%rip)     # 0x60400
movq %rbx, %rdi
movl $0xa0, %esi
callq 0x64db
movq %rax, %r14
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x1e3d2
testq %r14, %r14
je 0x1e544
movb 0x90(%r14), %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 $-0x40, %al
orb $0x31, %al
movb %al, 0x90(%r14)
movl $0x0, 0x80(%r14)
andb $-0x4, 0x98(%r14)
movups %xmm0, 0x50(%r14)
leaq 0x2ff(%rip), %rsi       # 0x1e5d0
movq %rbx, %rdi
callq 0x647b
movq %rbx, %rdi
callq 0x2695e
leaq 0x6b8(%rip), %rsi       # 0x1e9a0
movq %rax, %rdi
callq 0x647b
leaq 0x7e8(%rip), %rsi       # 0x1eadf
movq %rbx, %rdi
callq 0x64ab
testq %r15, %r15
je 0x1e3e3
movq 0x8(%r14), %rdi
leaq 0x7fd(%rip), %rsi       # 0x1eb10
callq 0x64ab
movq %r15, %rdi
callq 0x6af7
movq %rax, %r12
movq 0x50(%rax), %rsi
movq %rbx, %rdi
callq 0x19ed4
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 0x1e3a6
movq %rbx, %rdi
callq 0x1ed9b
movq 0x58(%r12), %rsi
testq %rsi, %rsi
je 0x1e4b8
movq %rbx, %rdi
callq 0x19ed4
jmp 0x1e4ba
leaq 0x20d08(%rip), %rdi     # 0x3f0d0
movq %rbx, %rsi
callq 0x8294
jmp 0x1e3d0
leaq 0x20cf7(%rip), %rdi     # 0x3f0d0
movq %r14, %rsi
callq 0x8294
jmp 0x1e3e1
movq %rbx, %rdi
callq 0x2695e
movq %rax, %rdi
movl $0x2, %esi
movl $0x2, %edx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x22d84
movq %rbx, %rdi
xorl %esi, %esi
callq 0x19ed4
movq %rax, 0x50(%r14)
movq 0x8(%r14), %rdi
leaq 0x6ef(%rip), %rsi       # 0x1eb10
callq 0x64ab
movq 0x50(%r14), %rdi
movl $0x1, %esi
callq 0x1a602
movq 0x50(%r14), %rdi
leaq 0x215c5(%rip), %rsi     # 0x3fa04
callq 0x1a6da
movq 0x50(%r14), %rdi
xorl %esi, %esi
callq 0x5ff7
movq %rbx, %rdi
movl $0xc8, %esi
movl $0x64, %edx
callq 0x5557
movq %rbx, %rdi
movl $0x2, %esi
callq 0x2636f
leaq 0x41c53(%rip), %rdx     # 0x600c8
movq %rbx, %rdi
movl $0x1, %esi
callq 0x2640b
callq 0x2e91c
testq %rax, %rax
je 0x1e565
movq %rax, %r15
movq 0x220(%rax), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1ecf4
movq 0x238(%r15), %rdx
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x1e571
xorl %eax, %eax
movq %rax, 0x58(%r14)
movq 0x60(%r12), %rdi
testq %rdi, %rdi
je 0x1e505
callq 0x2a0fb
movzwl %ax, %r13d
movq %r13, %rdi
callq 0x29f85
movq %rax, 0x60(%r14)
movq %rax, %rdi
callq 0x80e4
movq 0x60(%r14), %rsi
testb %al, %al
je 0x1e557
testq %rsi, %rsi
je 0x1e544
movq 0x60(%r12), %rax
movq %rsi, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x20f0
testb $0x2, 0x98(%r12)
je 0x1e51d
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1ee01
movq %r15, %rdi
movl $0x2, %esi
callq 0x1ef7b
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x1ecf4
movq %rbx, %rdi
callq 0x5e54
jmp 0x1e576
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x20b72(%rip), %rdi     # 0x3f0d0
callq 0x8294
jmp 0x1e563
leaq 0x41a3c(%rip), %rdx     # 0x5ffa8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1ecf4
movzwl 0x84(%r14), %eax
testw %ax, %ax
je 0x1e546
leaq 0x8(%rsp), %rdi
movq %rbx, (%rdi)
leaq 0xa74(%rip), %rcx       # 0x1f006
movq %rcx, 0x8(%rdi)
movw %ax, 0x28(%rdi)
movw $0x0, 0x2a(%rdi)
movq $0x0, 0x18(%rdi)
movq $0x1, 0x20(%rdi)
movb $-0x1, 0x30(%rdi)
movl $0x0, 0x2c(%rdi)
leaq 0xb992(%rip), %rax      # 0x29f54
movq %rax, 0x10(%rdi)
callq 0x29bb4
jmp 0x1e546