// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_label.c
// Function: lv_label_set_text
void lv_label_set_text(lv_obj_t * label, const char * text)
{
    LV_ASSERT_OBJ(label, LV_OBJX_NAME);

    lv_obj_invalidate(label);

    lv_label_ext_t * ext = lv_obj_get_ext_attr(label);

    /*If text is NULL then refresh */
    if(text == NULL) {
        lv_label_refr_text(label);
        return;
    }

    LV_ASSERT_STR(text);

    if(ext->text == text) {
        /*If set its own text then reallocate it (maybe its size changed)*/
        ext->text = lv_mem_realloc(ext->text, strlen(ext->text) + 1);
        LV_ASSERT_MEM(ext->text);
        if(ext->text == NULL) return;
    } else {
        /*Allocate space for the new text*/
        size_t len = strlen(text) + 1;
        if(ext->text != NULL && ext->static_txt == 0) {
            lv_mem_free(ext->text);
            ext->text = NULL;
        }

        ext->text = lv_mem_alloc(len);
        LV_ASSERT_MEM(ext->text);
        if(ext->text == NULL) return;

        strcpy(ext->text, text);

        /*Now the text is dynamically allocated*/
        ext->static_txt = 0;
    }

    lv_label_refr_text(label);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x2a65f
movq -0x8(%rbp), %rsi
leaq 0x3daa4(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x2a65d
movq -0x8(%rbp), %rdi
callq 0x7430
movq -0x8(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x2a68a
movq -0x8(%rbp), %rdi
callq 0x2adc0
jmp 0x2a7db
movq -0x10(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x2a6a9
movq -0x10(%rbp), %rsi
leaq 0x3da5a(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x2a6a7
movq -0x18(%rbp), %rax
movq (%rax), %rax
cmpq -0x10(%rbp), %rax
jne 0x2a720
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x2060
movq -0x28(%rbp), %rdi
movq %rax, %rsi
addq $0x1, %rsi
callq 0x44f70
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0xd120
testb $0x1, %al
jne 0x2a70c
movq -0x18(%rbp), %rax
movq (%rax), %rsi
leaq 0x3d93f(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x2a70a
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x2a71b
jmp 0x2a7db
jmp 0x2a7d2
movq -0x10(%rbp), %rdi
callq 0x2060
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2a76a
movq -0x18(%rbp), %rax
movw 0x18(%rax), %ax
shrw $0x3, %ax
andw $0x1, %ax
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x2a76a
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x44ec0
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x20(%rbp), %rdi
callq 0x44d20
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0xd120
testb $0x1, %al
jne 0x2a7a2
movq -0x18(%rbp), %rax
movq (%rax), %rsi
leaq 0x3d8a9(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x2a7a0
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x2a7ae
jmp 0x2a7db
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x2040
movq -0x18(%rbp), %rax
movw 0x18(%rax), %cx
andw $-0x9, %cx
orw $0x0, %cx
movw %cx, 0x18(%rax)
movq -0x8(%rbp), %rdi
callq 0x2adc0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)