// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_font/lv_font_fmt_txt.c
// Function: lv_font_get_glyph_dsc_fmt_txt
bool lv_font_get_glyph_dsc_fmt_txt(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next)
{
    lv_font_fmt_txt_dsc_t * fdsc = (lv_font_fmt_txt_dsc_t *) font->dsc;
    uint32_t gid = get_glyph_dsc_id(font, unicode_letter);
    if(!gid) return false;

    int8_t kvalue = 0;
    if(fdsc->kern_dsc) {
        uint32_t gid_next = get_glyph_dsc_id(font, unicode_letter_next);
        if(gid_next) {
            kvalue = get_kern_value(font, gid, gid_next);
        }
    }

    /*Put together a glyph dsc*/
    const lv_font_fmt_txt_glyph_dsc_t * gdsc = &fdsc->glyph_dsc[gid];

    int32_t kv = ((int32_t)((int32_t)kvalue * fdsc->kern_scale) >> 4);

    uint32_t adv_w = gdsc->adv_w + kv;
    adv_w  = (adv_w + (1 << 3)) >> 4;

    dsc_out->adv_w = adv_w;
    dsc_out->box_h = gdsc->box_h;
    dsc_out->box_w = gdsc->box_w;
    dsc_out->ofs_x = gdsc->ofs_x;
    dsc_out->ofs_y = gdsc->ofs_y;
    dsc_out->bpp   = (uint8_t)fdsc->bpp;

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %r12
movl %edx, %esi
callq 0x26263
movl %eax, %ebp
testl %eax, %eax
je 0x2651c
xorl %r13d, %r13d
cmpq $0x0, 0x18(%r12)
movl %ebp, %r8d
je 0x264e2
movq %r14, %rdi
movl %r15d, %esi
movq %r8, %r15
callq 0x26263
movq %r15, %r8
testl %eax, %eax
je 0x264e2
movq 0x18(%r14), %rcx
testb $0x20, 0x23(%rcx)
movq 0x18(%rcx), %r13
jne 0x26456
movl 0x10(%r13), %edx
movl %edx, %ecx
shrl $0x18, %ecx
andl $0x3, %ecx
cmpl $0x1, %ecx
je 0x2649b
testl %ecx, %ecx
jne 0x26497
movq (%r13), %r14
shll $0x8, %eax
addl %ebp, %eax
leaq 0xe(%rsp), %rdi
movw %ax, (%rdi)
andl $0xffffff, %edx         # imm = 0xFFFFFF
leaq 0xff(%rip), %r8         # 0x26539
pushq $0x2
popq %rcx
movq %r14, %rsi
callq 0x28faf
testq %rax, %rax
je 0x264d9
subq %r14, %rax
shrq %rax
jmp 0x264d0
movq 0x8(%r13), %rdx
movzbl (%rdx,%r8), %ecx
testq %rcx, %rcx
setne %sil
movl %eax, %eax
movb (%rdx,%rax), %al
testb %al, %al
setne %dl
andb %sil, %dl
cmpb $0x1, %dl
jne 0x26497
movzbl %al, %eax
movq (%r13), %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
addl %esi, %ecx
movzbl 0x19(%r13), %edi
imull %ecx, %edi
addl %esi, %eax
addl %edi, %eax
movb (%rdx,%rax), %al
jmp 0x264de
xorl %eax, %eax
jmp 0x264de
movq (%r13), %r14
shll $0x8, %eax
addl %ebp, %eax
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
andl $0xffffff, %edx         # imm = 0xFFFFFF
leaq 0x95(%rip), %r8         # 0x2654e
pushq $0x4
popq %rcx
movq %r14, %rsi
callq 0x28faf
testq %rax, %rax
je 0x264d9
subq %r14, %rax
shrq $0x4, %rax
movq 0x8(%r13), %rcx
movb (%rcx,%rax), %al
jmp 0x264db
xorl %eax, %eax
movq %r15, %r8
movsbl %al, %r13d
movq 0x8(%r12), %rax
movzwl 0x20(%r12), %ecx
imull %r13d, %ecx
shrl $0x4, %ecx
movl (%rax,%r8,8), %edx
shrl $0x14, %edx
addl %edx, %ecx
addl $0x8, %ecx
shrl $0x4, %ecx
movw %cx, (%rbx)
movl 0x4(%rax,%r8,8), %eax
movl %eax, 0x2(%rbx)
movzwl 0x22(%r12), %eax
shrl $0xa, %eax
andb $0x7, %al
movb %al, 0x6(%rbx)
testl %ebp, %ebp
setne %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq