// File: /workspace/github_c_makefile_star2_O3/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_ta.c
// Function: lv_ta_set_text
void lv_ta_set_text(lv_obj_t * ta, const char * txt)
{
    LV_ASSERT_OBJ(ta, LV_OBJX_NAME);
    LV_ASSERT_NULL(txt);

    lv_ta_ext_t * ext = lv_obj_get_ext_attr(ta);

    /*Clear the existing selection*/
    lv_ta_clear_selection(ta);

    /*Add the character one-by-one if not all characters are accepted or there is character limit.*/
    if(lv_ta_get_accepted_chars(ta) || lv_ta_get_max_length(ta)) {
        lv_label_set_text(ext->label, "");
        lv_ta_set_cursor_pos(ta, LV_TA_CURSOR_LAST);

        uint32_t i = 0;
        while(txt[i] != '\0') {
            uint32_t c = lv_txt_encoded_next(txt, &i);
            lv_ta_add_char(ta, lv_txt_unicode_to_encoded(c));
        }
    } else {
        lv_label_set_text(ext->label, txt);
        lv_ta_set_cursor_pos(ta, LV_TA_CURSOR_LAST);
    }

    /*Don't let 'width == 0' because the cursor will not be visible*/
    if(lv_obj_get_width(ext->label) == 0) {
        const lv_style_t * style = lv_obj_get_style(ext->label);
        lv_obj_set_width(ext->label, lv_font_get_glyph_width(style->text.font, ' ', '\0'));
    }

    if(ext->pwd_mode != 0) {
        ext->pwd_tmp = lv_mem_realloc(ext->pwd_tmp, strlen(txt) + 1);
        LV_ASSERT_MEM(ext->pwd_tmp);
        if(ext->pwd_tmp == NULL) return;
        strcpy(ext->pwd_tmp, txt);

#if LV_USE_ANIMATION
        /*Auto hide characters*/
        lv_anim_t a;
        a.var            = ta;
        a.exec_cb        = (lv_anim_exec_xcb_t)pwd_char_hider_anim;
        a.time           = ext->pwd_show_time;
        a.act_time       = 0;
        a.ready_cb       = pwd_char_hider_anim_ready;
        a.start          = 0;
        a.end            = 1;
        a.repeat         = 0;
        a.repeat_pause   = 0;
        a.playback       = 0;
        a.playback_pause = 0;
        a.path_cb        = lv_anim_path_step;
        lv_anim_create(&a);
#else
        pwd_char_hider(ta);
#endif
    }

    placeholder_update(ta);

    lv_event_send(ta, LV_EVENT_VALUE_CHANGED, NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x80e4
testb %al, %al
je 0x1fc4a
movq %r14, %rdi
callq 0x80e4
testb %al, %al
je 0x1fc5b
movq %rbx, %rdi
callq 0x6af7
movq %rax, %r15
movq %rbx, %rdi
callq 0x80e4
testb %al, %al
je 0x1fc6c
movq %rbx, %rdi
callq 0x1f8f0
testq %rax, %rax
jne 0x1fbe6
movq %rbx, %rdi
callq 0x1f91c
testw %ax, %ax
je 0x1fc7d
movq 0x50(%r15), %rdi
leaq 0x239cc(%rip), %rsi     # 0x435bd
callq 0x1a6da
movq %rbx, %rdi
movl $0x7fff, %esi           # imm = 0x7FFF
callq 0x1f5c6
movl $0x0, (%rsp)
cmpb $0x0, (%r14)
je 0x1fc96
leaq 0x33a15(%rip), %r13     # 0x53630
movq %rsp, %r12
leaq 0x339fb(%rip), %rbp     # 0x53620
movq %r14, %rdi
movq %r12, %rsi
callq *(%r13)
movl %eax, %edi
callq *(%rbp)
movq %rbx, %rdi
movl %eax, %esi
callq 0x1f08f
movl (%rsp), %eax
cmpb $0x0, (%r14,%rax)
jne 0x1fc25
jmp 0x1fc96
leaq 0x1f593(%rip), %rdi     # 0x3f1e4
movq %rbx, %rsi
callq 0x8294
jmp 0x1fc59
leaq 0x1f582(%rip), %rdi     # 0x3f1e4
movq %r14, %rsi
callq 0x8294
jmp 0x1fc6a
leaq 0x1f571(%rip), %rdi     # 0x3f1e4
movq %rbx, %rsi
callq 0x8294
jmp 0x1fc7b
movq 0x50(%r15), %rdi
movq %r14, %rsi
callq 0x1a6da
movq %rbx, %rdi
movl $0x7fff, %esi           # imm = 0x7FFF
callq 0x1f5c6
movq 0x50(%r15), %rdi
callq 0x566d
testw %ax, %ax
jne 0x1fccc
movq 0x50(%r15), %rdi
callq 0x66b6
movq 0x50(%r15), %r12
movq 0x28(%rax), %rdi
movl $0x20, %esi
xorl %edx, %edx
callq 0x28487
movswl %ax, %esi
movq %r12, %rdi
callq 0x570d
testb $0x1, 0x98(%r15)
je 0x1fd6e
movq 0x60(%r15), %r12
movq %r14, %rdi
callq 0x2070
leaq 0x1(%rax), %rsi
movq %r12, %rdi
callq 0x2a06f
movq %rax, 0x60(%r15)
movq %rax, %rdi
callq 0x80e4
movq 0x60(%r15), %rsi
testb %al, %al
je 0x1fd94
testq %rsi, %rsi
je 0x1fd85
movq %rsi, %rdi
movq %r14, %rsi
callq 0x2040
movq %rsp, %rdi
movq %rbx, (%rdi)
leaq -0x76a(%rip), %rax      # 0x1f5bd
movq %rax, 0x8(%rdi)
movzwl 0x72(%r15), %eax
movw %ax, 0x28(%rdi)
movw $0x0, 0x2a(%rdi)
leaq -0x783(%rip), %rax      # 0x1f5be
movq %rax, 0x18(%rdi)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x20(%rdi)
movl $0x0, 0x2c(%rdi)
movb $0x0, 0x30(%rdi)
leaq 0xa1ef(%rip), %rax      # 0x29f54
movq %rax, 0x10(%rdi)
callq 0x29bb4
movq %rbx, %rdi
callq 0x1f852
movq %rbx, %rdi
movl $0xe, %esi
xorl %edx, %edx
callq 0x5018
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f335(%rip), %rdi     # 0x3f0d0
callq 0x8294
jmp 0x1fda0