// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x32fb2
movq -0x8(%rbp), %rsi
leaq 0x35151(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x32fb0
movq -0x10(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x32fd1
movq -0x10(%rbp), %rsi
leaq 0x35132(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x32fcf
movq -0x8(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x326e0
movq -0x8(%rbp), %rdi
callq 0x32bf0
cmpq $0x0, %rax
jne 0x33007
movq -0x8(%rbp), %rdi
callq 0x32c40
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x3307d
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rdi
leaq 0x390ff(%rip), %rsi     # 0x6c115
callq 0x2a630
movq -0x8(%rbp), %rdi
movl $0x7fff, %esi           # imm = 0x7FFF
callq 0x32770
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x3307b
leaq 0x49679(%rip), %rax     # 0x7c6c0
movq (%rax), %rax
movq -0x10(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq *%rax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq 0x4964a(%rip), %rax     # 0x7c6b0
movq (%rax), %rax
movl -0x20(%rbp), %edi
callq *%rax
movq -0x68(%rbp), %rdi
movl %eax, %esi
callq 0x31fa0
jmp 0x33030
jmp 0x3309c
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x2a630
movq -0x8(%rbp), %rdi
movl $0x7fff, %esi           # imm = 0x7FFF
callq 0x32770
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x8310
cwtl
cmpl $0x0, %eax
jne 0x330ec
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0xa080
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rdi
movl $0x20, %esi
xorl %edx, %edx
callq 0x415e0
movq -0x70(%rbp), %rdi
movswl %ax, %esi
callq 0x8430
movq -0x18(%rbp), %rax
movb 0x98(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x331ee
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2060
movq -0x78(%rbp), %rdi
movq %rax, %rsi
addq $0x1, %rsi
callq 0x44f70
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rdi
callq 0xd120
testb $0x1, %al
jne 0x3315b
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rsi
leaq 0x34ef0(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x33159
movq -0x18(%rbp), %rax
cmpq $0x0, 0x60(%rax)
jne 0x3316b
jmp 0x33209
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x2040
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq -0xa6b(%rip), %rax      # 0x32720
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movw 0x72(%rax), %ax
movw %ax, -0x38(%rbp)
movw $0x0, -0x36(%rbp)
leaq -0xa68(%rip), %rax      # 0x32740
movq %rax, -0x48(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x1, -0x3c(%rbp)
movb -0x30(%rbp), %al
andb $-0x3, %al
orb $0x0, %al
movb %al, -0x30(%rbp)
movw $0x0, -0x32(%rbp)
movb -0x30(%rbp), %al
andb $-0x2, %al
orb $0x0, %al
movb %al, -0x30(%rbp)
movw $0x0, -0x34(%rbp)
leaq 0x1194f(%rip), %rax     # 0x44b30
movq %rax, -0x50(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x444a0
movq -0x8(%rbp), %rdi
callq 0x32b00
movq -0x8(%rbp), %rdi
movl $0xe, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x7990
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)