LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_fs.c
// Function: lv_fs_up
char * lv_fs_up(char * path)
{
    size_t len = strlen(path);
    if(len == 0) return path;

    len--; /*Go before the trailing '\0'*/

    /*Ignore trailing '/' or '\'*/
    while(path[len] == '/' || path[len] == '\\') {
        path[len] = '\0';
        if(len > 0)
            len--;
        else
            return path;
    }

    size_t i;
    for(i = len; i > 0; i--) {
        if(path[i] == '/' || path[i] == '\\') break;
    }

    if(i > 0) path[i] = '\0';

    return path;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x2070
testq %rax, %rax
je 0x29285
decq %rax
movzbl (%rbx,%rax), %ecx
cmpl $0x2f, %ecx
je 0x2927b
cmpl $0x5c, %ecx
jne 0x2928a
movb $0x0, (%rbx,%rax)
addq $-0x1, %rax
jb 0x2926d
movq %rbx, %rax
popq %rbx
retq
testq %rax, %rax
je 0x29285
movzbl (%rbx,%rax), %ecx
cmpl $0x2f, %ecx
je 0x292a4
cmpl $0x5c, %ecx
je 0x292a4
decq %rax
jne 0x2928f
jmp 0x29285
movb $0x0, (%rbx,%rax)
jmp 0x29285
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_fs.c
// Function: lv_fs_get_last
const char * lv_fs_get_last(const char * path)
{
    size_t len = strlen(path);
    if(len == 0) return path;

    len--; /*Go before the trailing '\0'*/

    /*Ignore trailing '/' or '\'*/
    while(path[len] == '/' || path[len] == '\\') {
        if(len > 0)
            len--;
        else
            return path;
    }

    size_t i;
    for(i = len; i > 0; i--) {
        if(path[i] == '/' || path[i] == '\\') break;
    }

    /*No '/' or '\' in the path so return with path itself*/
    if(i == 0) return path;

    return &path[i + 1];
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x2070
testq %rax, %rax
je 0x292eb
movzbl -0x1(%rbx,%rax), %ecx
cmpl $0x2f, %ecx
je 0x292c7
cmpl $0x5c, %ecx
jne 0x292e0
decq %rax
jne 0x292b8
jmp 0x292eb
movzbl -0x1(%rbx,%rax), %ecx
cmpl $0x2f, %ecx
je 0x292e8
cmpl $0x5c, %ecx
je 0x292e8
decq %rax
cmpq $0x1, %rax
jne 0x292ce
jmp 0x292eb
addq %rax, %rbx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_anim.c
// Function: lv_anim_init
void lv_anim_init(lv_anim_t * a)
{
    memset(a, 0, sizeof(lv_anim_t));
    a->time    = 500;
    a->start   = 0;
    a->end     = 100;
    a->path_cb = lv_anim_path_linear;
}

// Assembly:
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movq $0x0, 0x30(%rdi)
movw $0x1f4, 0x28(%rdi)      # imm = 0x1F4
movabsq $0x6400000000, %rax     # imm = 0x6400000000
movq %rax, 0x20(%rdi)
leaq 0x5(%rip), %rax         # 0x294f5
movq %rax, 0x10(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_anim.c
// Function: lv_anim_create
void lv_anim_create(lv_anim_t * a)
{
    LV_LOG_TRACE("animation create started")
    /* Do not let two animations for the  same 'var' with the same 'fp'*/
    if(a->exec_cb != NULL) lv_anim_del(a->var, a->exec_cb); /*fp == NULL would delete all animations of var*/

    /*Add the new animation to the animation linked list*/
    lv_anim_t * new_anim = lv_ll_ins_head(&LV_GC_ROOT(_lv_anim_ll));
    LV_ASSERT_MEM(new_anim);
    if(new_anim == NULL) return;

    /*Initialize the animation descriptor*/
    a->playback_now = 0;
    memcpy(new_anim, a, sizeof(lv_anim_t));

    /*Set the start value*/
    if(new_anim->exec_cb) new_anim->exec_cb(new_anim->var, new_anim->start);

    /* Creating an animation changed the linked list.
     * It's important if it happens in a ready callback. (see `anim_task`)*/
    anim_list_changed = true;

    LV_LOG_TRACE("animation created")
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rsi
testq %rsi, %rsi
je 0x29539
movq (%rbx), %rdi
callq 0x295b1
leaq 0x3f018(%rip), %rdi     # 0x68558
callq 0x29c08
movq %rax, %r14
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x295a0
testq %r14, %r14
je 0x29598
andb $-0x5, 0x30(%rbx)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups %xmm0, (%r14)
movups %xmm2, 0x20(%r14)
movups %xmm1, 0x10(%r14)
movq 0x30(%rbx), %rax
movq %rax, 0x30(%r14)
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x29591
movq (%r14), %rdi
movswl 0x20(%r14), %esi
callq *%rax
movb $0x1, 0x36f28(%rip)     # 0x604c0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x15a99(%rip), %rdi     # 0x3f040
movq %r14, %rsi
callq 0x829e
jmp 0x295af
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_anim.c
// Function: lv_anim_del
bool lv_anim_del(void * var, lv_anim_exec_xcb_t exec_cb)
{
    lv_anim_t * a;
    lv_anim_t * a_next;
    bool del = false;
    a        = lv_ll_get_head(&LV_GC_ROOT(_lv_anim_ll));
    while(a != NULL) {
        /*'a' might be deleted, so get the next object while 'a' is valid*/
        a_next = lv_ll_get_next(&LV_GC_ROOT(_lv_anim_ll), a);

        if(a->var == var && (a->exec_cb == exec_cb || exec_cb == NULL)) {
            lv_ll_rem(&LV_GC_ROOT(_lv_anim_ll), a);
            lv_mem_free(a);
            anim_list_changed = true; /*Read by `anim_task`. It need to know if a delete occurred in
                                         the linked list*/
            del = true;
        }

        a = a_next;
    }

    return del;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x3ef8f(%rip), %rdi     # 0x68558
callq 0x29cce
testq %rax, %rax
je 0x29626
movq %rax, %r12
xorl %ebp, %ebp
leaq 0x3ef79(%rip), %r15     # 0x68558
movq %r15, %rdi
movq %r12, %rsi
callq 0x29dfb
movq %rax, %r13
cmpq %r14, (%r12)
jne 0x2961c
testq %rbx, %rbx
je 0x295ff
cmpq %rbx, 0x8(%r12)
jne 0x2961c
movq %r15, %rdi
movq %r12, %rsi
callq 0x29d38
movq %r12, %rdi
callq 0x29984
movb $0x1, 0x36ea7(%rip)     # 0x604c0
movb $0x1, %bpl
movq %r13, %r12
testq %r13, %r13
jne 0x295df
jmp 0x29628
xorl %ebp, %ebp
andb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_anim.c
// Function: lv_anim_count_running
uint16_t lv_anim_count_running(void)
{
    uint16_t cnt = 0;
    lv_anim_t * a;
    LV_LL_READ(LV_GC_ROOT(_lv_anim_ll), a) cnt++;

    return cnt++;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x3ef10(%rip), %rdi     # 0x68558
callq 0x29cce
xorl %ebx, %ebx
testq %rax, %rax
je 0x2966d
leaq 0x3eefd(%rip), %r14     # 0x68558
incl %ebx
movq %r14, %rdi
movq %rax, %rsi
callq 0x29dfb
testq %rax, %rax
jne 0x2965b
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_anim.c
// Function: lv_anim_speed_to_time
uint16_t lv_anim_speed_to_time(uint16_t speed, lv_anim_value_t start, lv_anim_value_t end)
{
    int32_t d     = LV_MATH_ABS((int32_t)start - end);
    uint32_t time = (int32_t)((int32_t)(d * 1000) / speed);

    if(time > UINT16_MAX) time = UINT16_MAX;

    if(time == 0) {
        time++;
    }

    return time;
}

// Assembly:
subl %edx, %esi
movl %esi, %eax
negl %eax
cmovsl %esi, %eax
movl $0xffff, %esi           # imm = 0xFFFF
andl %esi, %eax
imull $0x3e8, %eax, %ecx      # imm = 0x3E8
movl %ecx, %eax
xorl %edx, %edx
divl %edi
cmpl %esi, %eax
cmovael %esi, %eax
cmpl %edi, %ecx
movl $0x1, %ecx
cmovbl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_anim.c
// Function: lv_anim_path_ease_in
lv_anim_value_t lv_anim_path_ease_in(const lv_anim_t * a)
{
    /*Calculate the current step*/
    uint32_t t;
    if(a->time == a->act_time)
        t = 1024;
    else
        t = (uint32_t)((uint32_t)a->act_time * 1024) / a->time;

    int32_t step = lv_bezier3(t, 0, 1, 1, 1024);

    int32_t new_value;
    new_value = (int32_t)step * (a->end - a->start);
    new_value = new_value >> 10;
    new_value += a->start;

    return (lv_anim_value_t)new_value;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movzwl 0x28(%rdi), %ecx
movswl 0x2a(%rdi), %eax
movl $0x400, %edi            # imm = 0x400
cmpl %eax, %ecx
je 0x296c1
shll $0xa, %eax
xorl %edx, %edx
divl %ecx
movl %eax, %edi
xorl %esi, %esi
movl $0x1, %edx
movl $0x1, %ecx
movl $0x400, %r8d            # imm = 0x400
callq 0x2ae10
movl 0x20(%rbx), %ecx
movl 0x24(%rbx), %edx
subl %ecx, %edx
imull %edx, %eax
shrl $0xa, %eax
addl %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_anim.c
// Function: lv_anim_path_ease_in_out
lv_anim_value_t lv_anim_path_ease_in_out(const lv_anim_t * a)
{
    /*Calculate the current step*/

    uint32_t t;
    if(a->time == a->act_time)
        t = 1024;
    else
        t = (uint32_t)((uint32_t)a->act_time * 1024) / a->time;

    int32_t step = lv_bezier3(t, 0, 100, 924, 1024);

    int32_t new_value;
    new_value = (int32_t)step * (a->end - a->start);
    new_value = new_value >> 10;
    new_value += a->start;

    return (lv_anim_value_t)new_value;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movzwl 0x28(%rdi), %ecx
movswl 0x2a(%rdi), %eax
movl $0x400, %edi            # imm = 0x400
cmpl %eax, %ecx
je 0x2974f
shll $0xa, %eax
xorl %edx, %edx
divl %ecx
movl %eax, %edi
xorl %esi, %esi
movl $0x64, %edx
movl $0x39c, %ecx            # imm = 0x39C
movl $0x400, %r8d            # imm = 0x400
callq 0x2ae10
movl 0x20(%rbx), %ecx
movl 0x24(%rbx), %edx
subl %ecx, %edx
imull %edx, %eax
shrl $0xa, %eax
addl %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_anim.c
// Function: lv_anim_path_overshoot
lv_anim_value_t lv_anim_path_overshoot(const lv_anim_t * a)
{
    /*Calculate the current step*/

    uint32_t t;
    if(a->time == a->act_time)
        t = 1024;
    else
        t = (uint32_t)((uint32_t)a->act_time * 1024) / a->time;

    int32_t step = lv_bezier3(t, 0, 600, 1300, 1024);

    int32_t new_value;
    new_value = (int32_t)step * (a->end - a->start);
    new_value = new_value >> 10;
    new_value += a->start;

    return (lv_anim_value_t)new_value;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movzwl 0x28(%rdi), %ecx
movswl 0x2a(%rdi), %eax
movl $0x400, %edi            # imm = 0x400
cmpl %eax, %ecx
je 0x29796
shll $0xa, %eax
xorl %edx, %edx
divl %ecx
movl %eax, %edi
xorl %esi, %esi
movl $0x258, %edx            # imm = 0x258
movl $0x514, %ecx            # imm = 0x514
movl $0x400, %r8d            # imm = 0x400
callq 0x2ae10
movl 0x20(%rbx), %ecx
movl 0x24(%rbx), %edx
subl %ecx, %edx
imull %edx, %eax
shrl $0xa, %eax
addl %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_anim.c
// Function: lv_anim_path_bounce
lv_anim_value_t lv_anim_path_bounce(const lv_anim_t * a)
{
    /*Calculate the current step*/
    uint32_t t;
    if(a->time == a->act_time)
        t = 1024;
    else
        t = (uint32_t)((uint32_t)a->act_time * 1024) / a->time;

    int32_t diff = (a->end - a->start);

    /*3 bounces has 5 parts: 3 down and 2 up. One part is t / 5 long*/

    if(t < 408) {
        /*Go down*/
        t = (t * 2500) >> 10; /*[0..1024] range*/
    } else if(t >= 408 && t < 614) {
        /*First bounce back*/
        t -= 408;
        t    = t * 5; /*to [0..1024] range*/
        t    = 1024 - t;
        diff = diff / 6;
    } else if(t >= 614 && t < 819) {
        /*Fall back*/
        t -= 614;
        t    = t * 5; /*to [0..1024] range*/
        diff = diff / 6;
    } else if(t >= 819 && t < 921) {
        /*Second bounce back*/
        t -= 819;
        t    = t * 10; /*to [0..1024] range*/
        t    = 1024 - t;
        diff = diff / 16;
    } else if(t >= 921 && t <= 1024) {
        /*Fall back*/
        t -= 921;
        t    = t * 10; /*to [0..1024] range*/
        diff = diff / 16;
    }

    if(t > 1024) t = 1024;

    int32_t step = lv_bezier3(t, 1024, 1024, 800, 0);

    int32_t new_value;
    new_value = (int32_t)step * diff;
    new_value = new_value >> 10;
    new_value = a->end - new_value;

    return (lv_anim_value_t)new_value;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzwl 0x28(%rdi), %ecx
movswl 0x2a(%rdi), %eax
movl $0x400, %edi            # imm = 0x400
cmpl %eax, %ecx
je 0x297e0
shll $0xa, %eax
xorl %edx, %edx
divl %ecx
movl %eax, %edi
movl 0x24(%rbx), %r14d
subl 0x20(%rbx), %r14d
cmpl $0x197, %edi            # imm = 0x197
ja 0x297fb
imull $0x9c4, %edi, %edi      # imm = 0x9C4
shrl $0xa, %edi
jmp 0x29838
cmpl $0x265, %edi            # imm = 0x265
ja 0x2980f
leal (%rdi,%rdi,4), %eax
movl $0xbf8, %edi            # imm = 0xBF8
subl %eax, %edi
jmp 0x29820
cmpl $0x332, %edi            # imm = 0x332
ja 0x2986f
leal (%rdi,%rdi,4), %edi
addl $0xfffff402, %edi       # imm = 0xFFFFF402
movslq %r14d, %rax
imulq $0x2aaaaaab, %rax, %r14 # imm = 0x2AAAAAAB
movq %r14, %rax
shrq $0x3f, %rax
shrq $0x20, %r14
addl %eax, %r14d
movl $0x400, %eax            # imm = 0x400
cmpl %eax, %edi
cmovael %eax, %edi
movl $0x400, %esi            # imm = 0x400
movl $0x400, %edx            # imm = 0x400
movl $0x320, %ecx            # imm = 0x320
xorl %r8d, %r8d
callq 0x2ae10
imull %r14d, %eax
shrl $0xa, %eax
movl 0x24(%rbx), %ecx
subl %eax, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpl $0x398, %edi            # imm = 0x398
ja 0x29885
addl %edi, %edi
leal (%rdi,%rdi,4), %eax
movl $0x23fe, %edi           # imm = 0x23FE
subl %eax, %edi
jmp 0x29897
cmpl $0x400, %edi            # imm = 0x400
ja 0x29838
leal (%rdi,%rdi,4), %eax
leal -0x23fa(,%rax,2), %edi
leal 0xf(%r14), %eax
testl %r14d, %r14d
cmovnsl %r14d, %eax
sarl $0x4, %eax
movl %eax, %r14d
jmp 0x29838
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_mem.c
// Function: lv_mem_free
void lv_mem_free(const void * data)
{
    if(data == &zero_mem) return;
    if(data == NULL) return;

#if LV_MEM_ADD_JUNK
    memset((void *)data, 0xbb, lv_mem_get_size(data));
#endif

#if LV_ENABLE_GC == 0
    /*e points to the header*/
    lv_mem_ent_t * e = (lv_mem_ent_t *)((uint8_t *)data - sizeof(lv_mem_header_t));
    e->header.s.used = 0;
#endif

#if LV_MEM_CUSTOM == 0
#if LV_MEM_AUTO_DEFRAG
    /* Make a simple defrag.
     * Join the following free entries after this*/
    lv_mem_ent_t * e_next;
    e_next = ent_get_next(e);
    while(e_next != NULL) {
        if(e_next->header.s.used == 0) {
            e->header.s.d_size += e_next->header.s.d_size + sizeof(e->header);
        } else {
            break;
        }
        e_next = ent_get_next(e_next);
    }
#endif
#else /*Use custom, user defined free function*/
#if LV_ENABLE_GC == 0
    LV_MEM_CUSTOM_FREE(e);
#else
    LV_MEM_CUSTOM_FREE((void *)data);
#endif /*LV_ENABLE_GC*/
#endif
}

// Assembly:
leaq 0x3eb4d(%rip), %rax     # 0x684d8
cmpq %rax, %rdi
sete %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x299f7
movl -0x4(%rdi), %eax
movl %eax, %ecx
andl $-0x2, %ecx
movl %ecx, -0x4(%rdi)
shrl %eax
leaq (%rdi,%rax), %rdx
addq $0x4, %rdx
movl $0x8000, %ecx           # imm = 0x8000
addq 0x3eb14(%rip), %rcx     # 0x684d0
cmpq %rcx, %rdx
jae 0x299f7
addq %rdi, %rax
xorl %edx, %edx
movl (%rax), %esi
testb $0x1, %sil
jne 0x299f7
movl -0x4(%rdi), %r8d
addl %r8d, %esi
addl $0x8, %esi
movl %esi, -0x4(%rdi)
movl (%rax), %esi
shrl %esi
leaq (%rax,%rsi), %r8
addq $0x8, %r8
addq %rsi, %rax
addq $0x4, %rax
cmpq %rcx, %r8
cmovaeq %rdx, %rax
jb 0x299c6
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_mem.c
// Function: lv_mem_realloc
void * lv_mem_realloc(void * data_p, size_t new_size)
{
    /*data_p could be previously freed pointer (in this case it is invalid)*/
    if(data_p != NULL) {
        lv_mem_ent_t * e = (lv_mem_ent_t *)((uint8_t *)data_p - sizeof(lv_mem_header_t));
        if(e->header.s.used == 0) {
            data_p = NULL;
        }
    }

    uint32_t old_size = lv_mem_get_size(data_p);
    if(old_size == new_size) return data_p; /*Also avoid reallocating the same memory*/

#if LV_MEM_CUSTOM == 0
    /* Truncate the memory if the new size is smaller. */
    if(new_size < old_size) {
        lv_mem_ent_t * e = (lv_mem_ent_t *)((uint8_t *)data_p - sizeof(lv_mem_header_t));
        ent_trunc(e, new_size);
        return &e->first_data;
    }
#endif

    void * new_p;
    new_p = lv_mem_alloc(new_size);

    if(new_p != NULL && data_p != NULL) {
        /*Copy the old data to the new. Use the smaller size*/
        if(old_size != 0) {
            memcpy(new_p, data_p, LV_MATH_MIN(new_size, old_size));
            lv_mem_free(data_p);
        }
    }

    if(new_p == NULL) LV_LOG_WARN("Couldn't allocate memory");

    return new_p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
xorl %eax, %eax
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x29a0e
testb $0x1, -0x4(%rdi)
cmovneq %rdi, %rbx
testq %rbx, %rbx
sete %cl
leaq 0x3eabd(%rip), %rdx     # 0x684d8
cmpq %rdx, %rbx
sete %dl
orb %cl, %dl
jne 0x29a2a
movl -0x4(%rbx), %eax
shrl %eax
movl %eax, %r14d
cmpq %rsi, %r14
je 0x29a72
jbe 0x29a3f
leaq -0x4(%rbx), %rdi
callq 0x29a9a
jmp 0x29a72
movq %rsi, %rdi
callq 0x298d9
movq %rax, %r15
testq %r14, %r14
je 0x29a6f
testq %rbx, %rbx
je 0x29a6f
testq %r15, %r15
je 0x29a6f
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x20f0
movq %rbx, %rdi
callq 0x29984
movq %r15, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_mem.c
// Function: lv_mem_defrag
static lv_mem_ent_t * ent_get_next(lv_mem_ent_t * act_e)
{
    lv_mem_ent_t * next_e = NULL;

    if(act_e == NULL) { /*NULL means: get the first entry*/
        next_e = (lv_mem_ent_t *)work_mem;
    } else { /*Get the next entry */
        uint8_t * data = &act_e->first_data;
        next_e         = (lv_mem_ent_t *)&data[act_e->header.s.d_size];

        if(&next_e->first_data >= &work_mem[LV_MEM_SIZE]) next_e = NULL;
    }

    return next_e;
}

// Assembly:
movq 0x3e9f3(%rip), %rdx     # 0x684d0
testq %rdx, %rdx
je 0x29b6e
movl $0x8000, %eax           # imm = 0x8000
xorl %ecx, %ecx
movq 0x3e9dc(%rip), %rdi     # 0x684d0
addq %rax, %rdi
movq %rdx, %rsi
movl (%rsi), %r9d
movl %r9d, %r8d
shrl %r8d
leaq (%rsi,%r8), %rdx
addq $0x4, %rdx
addq %rsi, %r8
addq $0x8, %r8
testb $0x1, %r9b
je 0x29b26
cmpq %rdi, %r8
cmovaeq %rcx, %rdx
movq %rdx, %rsi
jb 0x29afa
jmp 0x29b6e
movq 0x3e9a3(%rip), %rdi     # 0x684d0
addq %rax, %rdi
cmpq %rdi, %r8
jae 0x29b6e
movl (%rdx), %edi
testb $0x1, %dil
jne 0x29aed
movl (%rsi), %r8d
addl %r8d, %edi
addl $0x8, %edi
movl %edi, (%rsi)
movl (%rdx), %edi
shrl %edi
leaq (%rdx,%rdi), %r8
addq $0x8, %r8
addq %rdi, %rdx
addq $0x4, %rdx
movq 0x3e96e(%rip), %rdi     # 0x684d0
addq %rax, %rdi
cmpq %rdi, %r8
cmovaeq %rcx, %rdx
jb 0x29b35
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_mem.c
// Function: lv_mem_monitor
void lv_mem_monitor(lv_mem_monitor_t * mon_p)
{
    /*Init the data*/
    memset(mon_p, 0, sizeof(lv_mem_monitor_t));
#if LV_MEM_CUSTOM == 0
    lv_mem_ent_t * e;
    e = NULL;

    e = ent_get_next(e);

    while(e != NULL) {
        if(e->header.s.used == 0) {
            mon_p->free_cnt++;
            mon_p->free_size += e->header.s.d_size;
            if(e->header.s.d_size > mon_p->free_biggest_size) {
                mon_p->free_biggest_size = e->header.s.d_size;
            }
        } else {
            mon_p->used_cnt++;
        }

        e = ent_get_next(e);
    }
    mon_p->total_size = LV_MEM_SIZE;
    mon_p->used_pct   = 100 - (100U * mon_p->free_size) / mon_p->total_size;
    mon_p->frag_pct   = (uint32_t)mon_p->free_biggest_size * 100U / mon_p->free_size;
    mon_p->frag_pct   = 100 - mon_p->frag_pct;
#endif
}

// Assembly:
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x3e94c(%rip), %rax     # 0x684d0
testq %rax, %rax
je 0x29bce
leaq 0x8000(%rax), %rcx
xorl %edx, %edx
testb $0x1, (%rax)
jne 0x29baf
incl 0x4(%rdi)
movl (%rax), %esi
shrl %esi
addl %esi, 0x8(%rdi)
movl (%rax), %esi
shrl %esi
cmpl 0xc(%rdi), %esi
jbe 0x29bb2
movl %esi, 0xc(%rdi)
jmp 0x29bb2
incl 0x10(%rdi)
movl (%rax), %esi
shrl %esi
leaq (%rax,%rsi), %r8
addq $0x8, %r8
addq %rsi, %rax
addq $0x4, %rax
cmpq %rcx, %r8
cmovaeq %rdx, %rax
jb 0x29b92
movl $0x8000, (%rdi)         # imm = 0x8000
movl 0x8(%rdi), %ecx
imull $0x64, %ecx, %eax
shrl $0xf, %eax
movb $0x64, %sil
movb $0x64, %dl
subb %al, %dl
movb %dl, 0x14(%rdi)
imull $0x64, 0xc(%rdi), %eax
xorl %edx, %edx
divl %ecx
subb %al, %sil
movb %sil, 0x15(%rdi)
retq
nop
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_ll.c
// Function: lv_ll_ins_head
void * lv_ll_ins_head(lv_ll_t * ll_p)
{
    lv_ll_node_t * n_new;

    n_new = lv_mem_alloc(ll_p->n_size + LL_NODE_META_SIZE);

    if(n_new != NULL) {
        node_set_prev(ll_p, n_new, NULL);       /*No prev. before the new head*/
        node_set_next(ll_p, n_new, ll_p->head); /*After new comes the old head*/

        if(ll_p->head != NULL) { /*If there is old head then before it goes the new*/
            node_set_prev(ll_p, ll_p->head, n_new);
        }

        ll_p->head = n_new;      /*Set the new head in the dsc.*/
        if(ll_p->tail == NULL) { /*If there is no tail (1. node) set the tail too*/
            ll_p->tail = n_new;
        }
    }

    return n_new;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %edi
addq $0x10, %rdi
callq 0x298d9
testq %rax, %rax
je 0x29c4f
movl (%rbx), %ecx
movq $0x0, (%rax,%rcx)
movq 0x8(%rbx), %rcx
movl (%rbx), %edx
movq %rcx, 0x8(%rax,%rdx)
movq 0x8(%rbx), %rcx
testq %rcx, %rcx
je 0x29c40
movl (%rbx), %edx
movq %rax, (%rcx,%rdx)
movq %rax, 0x8(%rbx)
cmpq $0x0, 0x10(%rbx)
jne 0x29c4f
movq %rax, 0x10(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_ll.c
// Function: lv_ll_ins_prev
void * lv_ll_ins_prev(lv_ll_t * ll_p, void * n_act)
{
    lv_ll_node_t * n_new;
    lv_ll_node_t * n_prev;

    if(NULL == ll_p || NULL == n_act) return NULL;

    if(lv_ll_get_head(ll_p) == n_act) {
        n_new = lv_ll_ins_head(ll_p);
        if(n_new == NULL) return NULL;
    } else {
        n_new = lv_mem_alloc(ll_p->n_size + LL_NODE_META_SIZE);
        if(n_new == NULL) return NULL;

        n_prev = lv_ll_get_prev(ll_p, n_act);
        node_set_next(ll_p, n_prev, n_new);
        node_set_prev(ll_p, n_new, n_prev);
        node_set_prev(ll_p, n_act, n_new);
        node_set_next(ll_p, n_new, n_act);
    }

    return n_new;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0x29c69
xorl %eax, %eax
jmp 0x29cc6
movq %rsi, %rbx
movq %rdi, %r14
cmpq %rsi, 0x8(%rdi)
je 0x29ca0
movl (%r14), %edi
addq $0x10, %rdi
callq 0x298d9
testq %rax, %rax
je 0x29c65
movl (%r14), %ecx
movq (%rbx,%rcx), %rdx
testq %rdx, %rdx
je 0x29caf
movq %rax, 0x8(%rdx,%rcx)
movl (%r14), %ecx
movq %rdx, (%rax,%rcx)
jmp 0x29cb7
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x29c08
movq $0x0, (%rax,%rcx)
movl (%r14), %ecx
movq %rax, (%rbx,%rcx)
movl (%r14), %ecx
movq %rbx, 0x8(%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_ll.c
// Function: lv_ll_ins_tail
void * lv_ll_ins_tail(lv_ll_t * ll_p)
{
    lv_ll_node_t * n_new;

    n_new = lv_mem_alloc(ll_p->n_size + LL_NODE_META_SIZE);
    if(n_new == NULL) return NULL;

    if(n_new != NULL) {
        node_set_next(ll_p, n_new, NULL);       /*No next after the new tail*/
        node_set_prev(ll_p, n_new, ll_p->tail); /*The prev. before new is tho old tail*/
        if(ll_p->tail != NULL) {                /*If there is old tail then the new comes after it*/
            node_set_next(ll_p, ll_p->tail, n_new);
        }

        ll_p->tail = n_new;      /*Set the new tail in the dsc.*/
        if(ll_p->head == NULL) { /*If there is no head (1. node) set the head too*/
            ll_p->head = n_new;
        }
    }

    return n_new;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %edi
addq $0x10, %rdi
callq 0x298d9
testq %rax, %rax
je 0x29d34
movl (%rbx), %ecx
movq $0x0, 0x8(%rax,%rcx)
movq 0x10(%rbx), %rcx
movl (%rbx), %edx
movq %rcx, (%rax,%rdx)
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x29d23
movl (%rbx), %edx
movq %rax, 0x8(%rcx,%rdx)
movq %rax, 0x10(%rbx)
cmpq $0x0, 0x8(%rbx)
jne 0x29d36
movq %rax, 0x8(%rbx)
jmp 0x29d36
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_ll.c
// Function: lv_ll_rem
void * lv_ll_get_head(const lv_ll_t * ll_p)
{
    void * head = NULL;

    if(ll_p != NULL) {
        head = ll_p->head;
    }

    return head;
}

// Assembly:
testq %rdi, %rdi
je 0x29d43
movq 0x8(%rdi), %rax
jmp 0x29d45
xorl %eax, %eax
cmpq %rsi, %rax
je 0x29d55
testq %rdi, %rdi
je 0x29d63
movq 0x10(%rdi), %rax
jmp 0x29d65
testq %rdi, %rdi
je 0x29db3
movl (%rdi), %eax
movq 0x8(%rsi,%rax), %rax
jmp 0x29db5
xorl %eax, %eax
cmpq %rsi, %rax
je 0x29d77
testq %rdi, %rdi
je 0x29d84
movl (%rdi), %eax
movq (%rsi,%rax), %rax
jmp 0x29d86
testq %rdi, %rdi
je 0x29ddb
movl (%rdi), %eax
movq (%rsi,%rax), %rax
jmp 0x29ddd
xorl %eax, %eax
testq %rdi, %rdi
je 0x29d94
movl (%rdi), %ecx
movq 0x8(%rsi,%rcx), %rcx
jmp 0x29d96
xorl %ecx, %ecx
testq %rax, %rax
je 0x29da2
movl (%rdi), %edx
movq %rcx, 0x8(%rax,%rdx)
testq %rcx, %rcx
je 0x29dda
movl (%rdi), %edx
testq %rax, %rax
je 0x29dd2
movq %rax, (%rcx,%rdx)
retq
xorl %eax, %eax
movq %rax, 0x8(%rdi)
testq %rax, %rax
je 0x29dc9
movl (%rdi), %ecx
movq $0x0, (%rax,%rcx)
retq
movq $0x0, 0x10(%rdi)
retq
movq $0x0, (%rcx,%rdx)
retq
xorl %eax, %eax
movq %rax, 0x10(%rdi)
testq %rax, %rax
je 0x29df2
movl (%rdi), %ecx
movq $0x0, 0x8(%rax,%rcx)
retq
movq $0x0, 0x8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_ll.c
// Function: lv_ll_clear
void lv_ll_clear(lv_ll_t * ll_p)
{
    void * i;
    void * i_next;

    i      = lv_ll_get_head(ll_p);
    i_next = NULL;

    while(i != NULL) {
        i_next = lv_ll_get_next(ll_p, i);

        lv_ll_rem(ll_p, i);
        lv_mem_free(i);

        i = i_next;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
je 0x29e2b
movq 0x8(%rbx), %r14
jmp 0x29e2e
xorl %r14d, %r14d
testq %r14, %r14
je 0x29e5f
testq %rbx, %rbx
je 0x29e41
movl (%rbx), %eax
movq 0x8(%r14,%rax), %r15
jmp 0x29e44
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x29d38
movq %r14, %rdi
callq 0x29984
movq %r15, %r14
testq %r15, %r15
jne 0x29e33
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_ll.c
// Function: lv_ll_chg_list
void lv_ll_chg_list(lv_ll_t * ll_ori_p, lv_ll_t * ll_new_p, void * node, bool head)
{
    lv_ll_rem(ll_ori_p, node);

    if(head) {
        /*Set node as head*/
        node_set_prev(ll_new_p, node, NULL);
        node_set_next(ll_new_p, node, ll_new_p->head);

        if(ll_new_p->head != NULL) { /*If there is old head then before it goes the new*/
            node_set_prev(ll_new_p, ll_new_p->head, node);
        }

        ll_new_p->head = node;       /*Set the new head in the dsc.*/
        if(ll_new_p->tail == NULL) { /*If there is no tail (first node) set the tail too*/
            ll_new_p->tail = node;
        }
    } else {
        /*Set node as tail*/
        node_set_prev(ll_new_p, node, ll_new_p->tail);
        node_set_next(ll_new_p, node, NULL);

        if(ll_new_p->tail != NULL) { /*If there is old tail then after it goes the new*/
            node_set_next(ll_new_p, ll_new_p->tail, node);
        }

        ll_new_p->tail = node;       /*Set the new tail in the dsc.*/
        if(ll_new_p->head == NULL) { /*If there is no head (first node) set the head too*/
            ll_new_p->head = node;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdx, %rsi
callq 0x29d38
testl %ebp, %ebp
je 0x29ebf
testq %rbx, %rbx
je 0x29e8d
movl (%r14), %eax
movq $0x0, (%rbx,%rax)
testq %rbx, %rbx
je 0x29e9e
movq 0x8(%r14), %rax
movl (%r14), %ecx
movq %rax, 0x8(%rbx,%rcx)
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x29eae
movl (%r14), %ecx
movq %rbx, (%rax,%rcx)
movq %rbx, 0x8(%r14)
cmpq $0x0, 0x10(%r14)
jne 0x29efe
addq $0x10, %r14
jmp 0x29efb
testq %rbx, %rbx
je 0x29edb
movq 0x10(%r14), %rax
movl (%r14), %ecx
movq %rax, (%rbx,%rcx)
movl (%r14), %eax
movq $0x0, 0x8(%rbx,%rax)
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x29eec
movl (%r14), %ecx
movq %rbx, 0x8(%rax,%rcx)
movq %rbx, 0x10(%r14)
cmpq $0x0, 0x8(%r14)
jne 0x29efe
addq $0x8, %r14
movq %rbx, (%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_ll.c
// Function: lv_ll_get_len
uint32_t lv_ll_get_len(const lv_ll_t * ll_p)
{
    uint32_t len = 0;
    void * node;

    for(node = lv_ll_get_head(ll_p); node != NULL; node = lv_ll_get_next(ll_p, node)) {
        len++;
    }

    return len;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x29f10
movq 0x8(%rdi), %rcx
jmp 0x29f12
xorl %ecx, %ecx
testq %rcx, %rcx
je 0x29f30
xorl %eax, %eax
testq %rdi, %rdi
je 0x29f27
movl (%rdi), %edx
movq 0x8(%rcx,%rdx), %rcx
jmp 0x29f29
xorl %ecx, %ecx
incl %eax
testq %rcx, %rcx
jne 0x29f19
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_ll.c
// Function: lv_ll_move_before
void lv_ll_move_before(lv_ll_t * ll_p, void * n_act, void * n_after)
{
    if(n_act == n_after) return; /*Can't move before itself*/

    void * n_before;
    if(n_after != NULL)
        n_before = lv_ll_get_prev(ll_p, n_after);
    else
        n_before = lv_ll_get_tail(ll_p); /*if `n_after` is NULL `n_act` should be the new tail*/

    if(n_act == n_before) return; /*Already before `n_after`*/

    /*It's much easier to remove from the list and add again*/
    lv_ll_rem(ll_p, n_act);

    /*Add again by setting the prev. and next nodes*/
    node_set_next(ll_p, n_before, n_act);
    node_set_prev(ll_p, n_act, n_before);
    node_set_prev(ll_p, n_after, n_act);
    node_set_next(ll_p, n_act, n_after);

    /*If `n_act` was moved before NULL then it become the new tail*/
    if(n_after == NULL) ll_p->tail = n_act;

    /*If `n_act` was moved before `NULL` then it's the new head*/
    if(n_before == NULL) ll_p->head = n_act;
}

// Assembly:
cmpq %rdx, %rsi
je 0x29fcb
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
testq %rdx, %rdx
je 0x29f5e
testq %r14, %r14
je 0x29f69
movl (%r14), %eax
movq (%r15,%rax), %r12
jmp 0x29f6c
testq %r14, %r14
je 0x29f69
movq 0x10(%r14), %r12
jmp 0x29f6c
xorl %r12d, %r12d
cmpq %rbx, %r12
je 0x29fc0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x29d38
testq %r12, %r12
je 0x29f89
movl (%r14), %eax
movq %rbx, 0x8(%r12,%rax)
testq %rbx, %rbx
je 0x29f95
movl (%r14), %eax
movq %r12, (%rbx,%rax)
testq %r15, %r15
je 0x29fa1
movl (%r14), %eax
movq %rbx, (%r15,%rax)
testq %rbx, %rbx
je 0x29fae
movl (%r14), %eax
movq %r15, 0x8(%rbx,%rax)
testq %r15, %r15
jne 0x29fb7
movq %rbx, 0x10(%r14)
testq %r12, %r12
jne 0x29fc0
movq %rbx, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_color.c
// Function: lv_color_hsv_to_rgb
lv_color_t lv_color_hsv_to_rgb(uint16_t h, uint8_t s, uint8_t v)
{
    h = (uint32_t)((uint32_t)h * 255) / 360;
    s = (uint16_t)((uint16_t)s * 255) / 100;
    v = (uint16_t)((uint16_t)v * 255) / 100;

    uint8_t r, g, b;

    uint8_t region, remainder, p, q, t;

    if(s == 0) {
        r = v;
        g = v;
        b = v;
        return lv_color_make(v, v, v);
    }

    region    = h / 43;
    remainder = (h - (region * 43)) * 6;

    p = (v * (255 - s)) >> 8;
    q = (v * (255 - ((s * remainder) >> 8))) >> 8;
    t = (v * (255 - ((s * (255 - remainder)) >> 8))) >> 8;

    switch(region) {
        case 0:
            r = v;
            g = t;
            b = p;
            break;
        case 1:
            r = q;
            g = v;
            b = p;
            break;
        case 2:
            r = p;
            g = v;
            b = t;
            break;
        case 3:
            r = p;
            g = q;
            b = v;
            break;
        case 4:
            r = t;
            g = p;
            b = v;
            break;
        default:
            r = v;
            g = p;
            b = q;
            break;
    }

    lv_color_t result = lv_color_make(r, g, b);
    return result;
}

// Assembly:
movl %esi, %eax
shll $0x8, %eax
subl %esi, %eax
movl $0xffff, %esi           # imm = 0xFFFF
andl %esi, %eax
shrl $0x2, %eax
imull $0x147b, %eax, %ecx     # imm = 0x147B
shrl $0x11, %ecx
movl %edx, %eax
shll $0x8, %eax
subl %edx, %eax
andl %esi, %eax
shrl $0x2, %eax
imull $0x147b, %eax, %eax     # imm = 0x147B
shrl $0x11, %eax
andw $0xff, %cx
je 0x2a0b4
movzwl %cx, %r8d
movzwl %di, %ecx
movl %ecx, %edx
shll $0x8, %edx
subl %ecx, %edx
imulq $0xb60b61, %rdx, %rcx   # imm = 0xB60B61
shrq $0x20, %rcx
imulq $0x10ef32b, %rdx, %rdi  # imm = 0x10EF32B
shrq $0x26, %rdi
imull $0xd5, %edi, %edx
addl %ecx, %edx
addl %edx, %edx
leal (%rdx,%rdx,2), %esi
movzwl %ax, %r10d
movl $0xff, %r9d
andl %r9d, %r10d
movl %r8d, %edx
xorl %r9d, %edx
imull %r10d, %edx
shrl $0x8, %edx
andl %r9d, %esi
movl %esi, %ecx
imull %r8d, %ecx
shrl $0x8, %ecx
xorl %r9d, %ecx
imull %r10d, %ecx
shrl $0x8, %ecx
cmpb $0x4, %dil
ja 0x2a0ee
xorl %r9d, %esi
imull %r8d, %esi
shrl $0x8, %esi
xorl %r9d, %esi
imull %r10d, %esi
shrl $0x8, %esi
andl %edi, %r9d
leaq 0x18e49(%rip), %rdi     # 0x42eec
movslq (%rdi,%r9,4), %r8
addq %rdi, %r8
jmpq *%r8
movl %esi, %edi
movl %edx, %r8d
jmp 0x2a0f3
movzwl %ax, %eax
movl %eax, %ecx
shrl $0x3, %ecx
movl %ecx, %edx
andl $0x1f, %edx
andl $0xfc, %eax
shll $0xb, %ecx
leal (%rcx,%rax,8), %eax
jmp 0x2a113
movl %edx, %edi
movl %eax, %r8d
movl %esi, %ecx
jmp 0x2a0f5
movl %eax, %edi
movl %esi, %r8d
jmp 0x2a0e3
movl %ecx, %edi
movl %eax, %r8d
movl %edx, %ecx
jmp 0x2a0f5
movl %eax, %edi
movl %edx, %r8d
jmp 0x2a0f5
movl %edx, %edi
movl %ecx, %r8d
movl %eax, %ecx
shrb $0x3, %r8b
movzbl %r8b, %eax
shrb $0x2, %dil
movzbl %dil, %edx
shll $0x5, %edx
orl %eax, %edx
shrb $0x3, %cl
movzbl %cl, %eax
shll $0xb, %eax
orl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_color.c
// Function: lv_color_rgb_to_hsv
lv_color_hsv_t lv_color_rgb_to_hsv(uint8_t r8, uint8_t g8, uint8_t b8)
{
    uint16_t r = ((uint32_t)r8 << 10) / 255;
    uint16_t g = ((uint32_t)g8 << 10) / 255;
    uint16_t b = ((uint32_t)b8 << 10) / 255;

    uint16_t rgbMin = r < g ? (r < b ? r : b) : (g < b ? g : b);
    uint16_t rgbMax = r > g ? (r > b ? r : b) : (g > b ? g : b);

    lv_color_hsv_t hsv;

    // https://en.wikipedia.org/wiki/HSL_and_HSV#Lightness
    hsv.v = (100 * rgbMax) >> 10;

    int32_t delta = rgbMax - rgbMin;
    if (LV_MATH_ABS(delta) < 3) {
        hsv.h = 0;
        hsv.s = 0;
        return hsv;
    }

    // https://en.wikipedia.org/wiki/HSL_and_HSV#Saturation
    hsv.s = 100 * delta / rgbMax;
    if(hsv.s < 3) {
        hsv.h = 0;
        return hsv;
    }

    // https://en.wikipedia.org/wiki/HSL_and_HSV#Hue_and_chroma
    int32_t h;
    if(rgbMax == r)
        h = (((g - b) << 10) / delta) + (g < b ? (6 << 10) : 0); // between yellow & magenta
    else if(rgbMax == g)
        h = (((b - r) << 10) / delta) + (2 << 10); // between cyan & yellow
    else if(rgbMax == b)
        h = (((r - g) << 10) / delta) + (4 << 10); // between magenta & cyan
    else
        h = 0;
    h *= 60;
    h >>= 10;
    if (h < 0) h += 360;

    hsv.h = h;
    return hsv;
}

// Assembly:
pushq %rbp
pushq %rbx
shll $0xa, %edi
imulq $0x1010102, %rdi, %r10  # imm = 0x1010102
shrq $0x20, %r10
shll $0xa, %esi
imulq $0x1010102, %rsi, %r9   # imm = 0x1010102
shrq $0x20, %r9
shll $0xa, %edx
imulq $0x1010102, %rdx, %rsi  # imm = 0x1010102
shrq $0x20, %rsi
movl %r10d, %edi
subl %r9d, %edi
movl %r9d, %eax
cmovbl %r10d, %eax
movl %r9d, %ebx
cmoval %r10d, %ebx
cmpl %esi, %eax
cmovael %esi, %eax
cmpl %esi, %ebx
movl %esi, %r8d
cmoval %ebx, %r8d
movl %r8d, %r11d
subl %eax, %r11d
movl %r11d, %eax
negl %eax
cmovsl %r11d, %eax
xorl %ebp, %ebp
cmpl $0x3, %eax
jae 0x2a17e
xorl %ecx, %ecx
jmp 0x2a1f1
imull $0x64, %r11d, %eax
cltd
idivl %r8d
movl %eax, %ecx
movzbl %cl, %eax
cmpl $0x3, %eax
jb 0x2a1f1
cmpl %r10d, %r8d
jne 0x2a1b1
movl %r9d, %eax
subl %esi, %eax
shll $0xa, %eax
cltd
idivl %r11d
movl %eax, %edx
leal 0x1800(%rdx), %eax
cmpl %esi, %r9d
cmovael %edx, %eax
jmp 0x2a1dd
cmpl %r9d, %r8d
jne 0x2a1c9
subl %r10d, %esi
shll $0xa, %esi
movl %esi, %eax
cltd
idivl %r11d
addl $0x800, %eax            # imm = 0x800
jmp 0x2a1dd
xorl %eax, %eax
cmpl %ebx, %esi
jb 0x2a1dd
shll $0xa, %edi
movl %edi, %eax
cltd
idivl %r11d
addl $0x1000, %eax           # imm = 0x1000
imull $0x3c, %eax, %eax
sarl $0xa, %eax
leal 0x168(%rax), %edx
testl %eax, %eax
cmovnsl %eax, %edx
movzwl %dx, %ebp
imull $0x190000, %r8d, %edx   # imm = 0x190000
andl $0x7f000000, %edx       # imm = 0x7F000000
orl %ebp, %edx
movzbl %cl, %eax
shll $0x10, %eax
orl %edx, %eax
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_txt.c
// Function: lv_txt_utf8_size
static uint8_t lv_txt_utf8_size(const char * str)
{
    if((str[0] & 0x80) == 0)
        return 1;
    else if((str[0] & 0xE0) == 0xC0)
        return 2;
    else if((str[0] & 0xF0) == 0xE0)
        return 3;
    else if((str[0] & 0xF8) == 0xF0)
        return 4;
    return 0; /*If the char was invalid tell it's 1 byte long*/
}

// Assembly:
movzbl (%rdi), %ecx
movb $0x1, %al
testb %cl, %cl
js 0x2a25a
retq
movl %ecx, %edx
andl $-0x20, %edx
movb $0x2, %al
cmpl $0xc0, %edx
je 0x2a259
movl %ecx, %edx
andl $-0x10, %edx
movb $0x3, %al
cmpl $0xe0, %edx
je 0x2a259
andl $-0x8, %ecx
cmpl $0xf0, %ecx
sete %al
shlb $0x2, %al
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_txt.c
// Function: lv_txt_unicode_to_utf8
static uint32_t lv_txt_unicode_to_utf8(uint32_t letter_uni)
{
    if(letter_uni < 128) return letter_uni;
    uint8_t bytes[4];

    if(letter_uni < 0x0800) {
        bytes[0] = ((letter_uni >> 6) & 0x1F) | 0xC0;
        bytes[1] = ((letter_uni >> 0) & 0x3F) | 0x80;
        bytes[2] = 0;
        bytes[3] = 0;
    } else if(letter_uni < 0x010000) {
        bytes[0] = ((letter_uni >> 12) & 0x0F) | 0xE0;
        bytes[1] = ((letter_uni >> 6) & 0x3F) | 0x80;
        bytes[2] = ((letter_uni >> 0) & 0x3F) | 0x80;
        bytes[3] = 0;
    } else if(letter_uni < 0x110000) {
        bytes[0] = ((letter_uni >> 18) & 0x07) | 0xF0;
        bytes[1] = ((letter_uni >> 12) & 0x3F) | 0x80;
        bytes[2] = ((letter_uni >> 6) & 0x3F) | 0x80;
        bytes[3] = ((letter_uni >> 0) & 0x3F) | 0x80;
    }

    uint32_t * res_p = (uint32_t *)bytes;
    return *res_p;
}

// Assembly:
movl %edi, %eax
cmpl $0x80, %edi
jb 0x2a33c
cmpl $0x7ff, %eax            # imm = 0x7FF
ja 0x2a2b8
movl %eax, %ecx
shrl $0x6, %ecx
orl $0xc0, %ecx
andl $0x3f, %eax
orl $0x80, %eax
xorl %edi, %edi
xorl %esi, %esi
movl %eax, %edx
jmp 0x2a32d
cmpl $0xffff, %eax           # imm = 0xFFFF
ja 0x2a2e4
movl %eax, %ecx
shrl $0xc, %ecx
orl $0xe0, %ecx
movl %eax, %edx
shrl $0x6, %edx
andl $0x3f, %edx
movl $0x80, %esi
orl %esi, %edx
andl $0x3f, %eax
orl %esi, %eax
xorl %edi, %edi
movl %eax, %esi
jmp 0x2a32d
xorl %edi, %edi
movl $0x0, %esi
movl $0x0, %edx
movl $0x0, %ecx
cmpl $0x10ffff, %eax         # imm = 0x10FFFF
ja 0x2a32d
movl %eax, %ecx
shrl $0x12, %ecx
orl $0xf0, %ecx
movl %eax, %edx
shrl $0xc, %edx
andl $0x3f, %edx
movl $0x80, %edi
orl %edi, %edx
movl %eax, %esi
shrl $0x6, %esi
andl $0x3f, %esi
orl %edi, %esi
andl $0x3f, %eax
shll $0x18, %eax
orl $0x80000000, %eax       # imm = 0x80000000
movl %eax, %edi
shll $0x10, %esi
orl %edi, %esi
shll $0x8, %edx
orl %esi, %edx
movzbl %cl, %eax
orl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_txt.c
// Function: lv_txt_utf8_prev
static uint32_t lv_txt_utf8_prev(const char * txt, uint32_t * i)
{
    uint8_t c_size;
    uint8_t cnt = 0;

    /*Try to find a !0 long UTF-8 char by stepping one character back*/
    (*i)--;
    do {
        if(cnt >= 4) return 0; /*No UTF-8 char found before the initial*/

        c_size = lv_txt_encoded_size(&txt[*i]);
        if(c_size == 0) {
            if(*i != 0)
                (*i)--;
            else
                return 0;
        }
        cnt++;
    } while(c_size == 0);

    uint32_t i_tmp  = *i;
    uint32_t letter = lv_txt_encoded_next(txt, &i_tmp); /*Character found, get it*/

    return letter;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
decl (%rsi)
movb $0x5, %r15b
xorl %ebp, %ebp
decb %r15b
je 0x2a566
movl (%r14), %edi
addq %rbx, %rdi
callq *0x290db(%rip)          # 0x53618
testb %al, %al
jne 0x2a54d
movl (%r14), %ecx
testl %ecx, %ecx
je 0x2a566
decl %ecx
movl %ecx, (%r14)
testb %al, %al
je 0x2a52c
movl (%r14), %eax
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
movq %rbx, %rdi
callq *0x290cc(%rip)          # 0x53630
movl %eax, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_txt.c
// Function: lv_txt_utf8_get_byte_id
static uint32_t lv_txt_utf8_get_byte_id(const char * txt, uint32_t utf8_id)
{
    uint32_t i;
    uint32_t byte_cnt = 0;
    for(i = 0; i < utf8_id; i++) {
        uint8_t c_size = lv_txt_encoded_size(&txt[byte_cnt]);
        byte_cnt += c_size > 0 ? c_size : 1;
    }

    return byte_cnt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testl %esi, %esi
je 0x2a5aa
movl %esi, %ebx
movq %rdi, %r14
xorl %ebp, %ebp
movl $0x1, %r15d
movl %ebp, %edi
addq %r14, %rdi
callq *0x29082(%rip)          # 0x53618
movzbl %al, %eax
cmpb $0x2, %al
cmovbl %r15d, %eax
movzbl %al, %eax
addl %eax, %ebp
decl %ebx
jne 0x2a58b
jmp 0x2a5ac
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_txt.c
// Function: lv_txt_utf8_get_char_id
static uint32_t lv_txt_utf8_get_char_id(const char * txt, uint32_t byte_id)
{
    uint32_t i        = 0;
    uint32_t char_cnt = 0;

    while(i < byte_id) {
        lv_txt_encoded_next(txt, &i); /*'i' points to the next letter so use the prev. value*/
        char_cnt++;
    }

    return char_cnt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0x0, 0x4(%rsp)
testl %esi, %esi
je 0x2a5ee
movl %esi, %ebx
movq %rdi, %r14
xorl %ebp, %ebp
leaq 0x4(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq *0x2904c(%rip)          # 0x53630
incl %ebp
cmpl %ebx, 0x4(%rsp)
jb 0x2a5d8
jmp 0x2a5f0
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_txt.c
// Function: lv_txt_utf8_get_length
static uint32_t lv_txt_utf8_get_length(const char * txt)
{
    uint32_t len = 0;
    uint32_t i   = 0;

    while(txt[i] != '\0') {
        lv_txt_encoded_next(txt, &i);
        len++;
    }

    return len;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl $0x0, 0xc(%rsp)
cmpb $0x0, (%rdi)
je 0x2a636
movq %rdi, %rbx
xorl %ebp, %ebp
leaq 0xc(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq *0x29008(%rip)          # 0x53630
incl %ebp
movl 0xc(%rsp), %eax
cmpb $0x0, (%rbx,%rax)
jne 0x2a61c
jmp 0x2a638
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_txt.c
// Function: lv_txt_get_width
lv_coord_t lv_txt_get_width(const char * txt, uint16_t length, const lv_font_t * font, lv_coord_t letter_space,
                            lv_txt_flag_t flag)
{
    if(txt == NULL) return 0;
    if(font == NULL) return 0;

    uint32_t i                   = 0;
    lv_coord_t width             = 0;
    lv_txt_cmd_state_t cmd_state = LV_TXT_CMD_STATE_WAIT;
    uint32_t letter;
    uint32_t letter_next;

    if(length != 0) {
        while(i < length) {
            letter      = lv_txt_encoded_next(txt, &i);
            letter_next = lv_txt_encoded_next(&txt[i], NULL);
            if((flag & LV_TXT_FLAG_RECOLOR) != 0) {
                if(lv_txt_is_cmd(&cmd_state, letter) != false) {
                    continue;
                }
            }

            lv_coord_t char_width = lv_font_get_glyph_width(font, letter, letter_next);
            if(char_width > 0) {
                width += char_width;
                width += letter_space;
            }
        }

        if(width > 0) {
            width -= letter_space; /*Trim the last letter space. Important if the text is center
                                      aligned */
        }
    }

    return width;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r15
testq %rdi, %rdi
sete %al
testq %rdx, %rdx
sete %dil
orb %al, %dil
jne 0x2ac5d
movl $0x0, 0x4(%rsp)
testw %si, %si
je 0x2ac5d
movl %r8d, %ebp
movq %rdx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movzwl %si, %r14d
xorl %edx, %edx
movq $0x0, 0x8(%rsp)
movq %rdx, 0x20(%rsp)
movl %edx, %r13d
cmpl %r14d, 0x4(%rsp)
jae 0x2ac61
movl %r13d, %r12d
movq %r15, %rdi
leaq 0x4(%rsp), %rsi
callq *0x28a6f(%rip)          # 0x53630
movl %eax, %ebx
movl 0x4(%rsp), %edi
addq %r15, %rdi
xorl %esi, %esi
callq *0x28a5e(%rip)          # 0x53630
testb $0x1, %bpl
je 0x2ac24
cmpl $0x23, %ebx
sete %sil
cmpb $0x3, %r12b
setb %dl
movzbl %r12b, %edi
leal (,%rdi,8), %ecx
movl $0x1, %r8d
shrl %cl, %r8d
andb %sil, %dl
testb %dl, %dl
cmovel %edi, %r8d
cmpl $0x20, %ebx
sete %cl
incb %cl
movzbl %cl, %r13d
cmpb $0x1, %r8b
cmovnel %r8d, %r13d
je 0x2aba5
xorb $0x1, %r12b
andb %r12b, %dl
jne 0x2aba5
jmp 0x2ac2c
movq 0x20(%rsp), %rcx
movl %ecx, %r13d
movq 0x18(%rsp), %rdi
movl %ebx, %esi
movl %eax, %edx
callq 0x27d87
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rdx
addl %edx, %ecx
addl %eax, %ecx
testw %ax, %ax
cmovlel %edx, %ecx
movl %r13d, %edx
movl %ecx, %eax
movq %rax, 0x8(%rsp)
jmp 0x2ab9d
xorl %eax, %eax
jmp 0x2ac75
xorl %edx, %edx
movq 0x8(%rsp), %rax
testw %ax, %ax
movq 0x10(%rsp), %rcx
cmovlel %edx, %ecx
subl %ecx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_txt.c
// Function: lv_txt_ins
void lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt)
{
    size_t old_len = strlen(txt_buf);
    size_t ins_len = strlen(ins_txt);
    size_t new_len = ins_len + old_len;
    pos              = lv_txt_encoded_get_byte_id(txt_buf, pos); /*Convert to byte index instead of letter index*/

    /*Copy the second part into the end to make place to text to insert*/
    size_t i;
    for(i = new_len; i >= pos + ins_len; i--) {
        txt_buf[i] = txt_buf[i - ins_len];
    }

    /* Copy the text into the new space*/
    memcpy(txt_buf + pos, ins_txt, ins_len);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
callq 0x2070
movq %rax, %r12
movq %rbx, %rdi
callq 0x2070
movq %rax, %r15
leaq (%rax,%r12), %r13
movq %r14, %rdi
movl %ebp, %esi
callq *0x28954(%rip)          # 0x53640
movl %eax, %eax
movq %r15, %rcx
addq %rax, %rcx
cmpq %rcx, %r13
jb 0x2ad09
movb (%r14,%r12), %dl
movb %dl, (%r14,%r13)
decq %r13
decq %r12
jmp 0x2acf4
addq %rax, %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20f0