// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_font/lv_font_fmt_txt.c
// Function: rle_next
static uint8_t rle_next(void)
{
    uint8_t v = 0;
    uint8_t ret = 0;

    if(rle_state == RLE_STATE_SINGLE) {
        ret = get_bits(rle_in, rle_rdp, rle_bpp);
        if(rle_rdp != 0 && rle_prev_v == ret) {
            rle_cnt = 0;
            rle_state = RLE_STATE_REPEATE;
        }

        rle_prev_v = ret;
        rle_rdp += rle_bpp;
    }
    else if(rle_state == RLE_STATE_REPEATE) {
        v = get_bits(rle_in, rle_rdp, 1);
        rle_cnt++;
        rle_rdp += 1;
        if(v == 1) {
            ret = rle_prev_v;
            if(rle_cnt == 11) {
                rle_cnt = get_bits(rle_in, rle_rdp, 6);
                rle_rdp += 6;
                if(rle_cnt != 0) {
                    rle_state = RLE_STATE_COUNTER;
                } else {
                    ret = get_bits(rle_in, rle_rdp, rle_bpp);
                    rle_prev_v = ret;
                    rle_rdp += rle_bpp;
                    rle_state = RLE_STATE_SINGLE;
                }
            }
        } else {
            ret = get_bits(rle_in, rle_rdp, rle_bpp);
            rle_prev_v = ret;
            rle_rdp += rle_bpp;
            rle_state = RLE_STATE_SINGLE;
        }


    }
    else if(rle_state == RLE_STATE_COUNTER) {
        ret = rle_prev_v;
        rle_cnt--;
        if(rle_cnt == 0) {
            ret = get_bits(rle_in, rle_rdp, rle_bpp);
            rle_prev_v = ret;
            rle_rdp += rle_bpp;
            rle_state = RLE_STATE_SINGLE;
        }
    }

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb $0x0, -0x1(%rbp)
movb $0x0, -0x2(%rbp)
cmpl $0x0, 0x472d5(%rip)     # 0x8956c
jne 0x422ff
movq 0x472c0(%rip), %rdi     # 0x89560
movl 0x472ca(%rip), %esi     # 0x89570
movzbl 0x472bb(%rip), %edx     # 0x89568
callq 0x424c0
movb %al, -0x2(%rbp)
cmpl $0x0, 0x472b4(%rip)     # 0x89570
je 0x422de
movzbl 0x472af(%rip), %eax     # 0x89574
movzbl -0x2(%rbp), %ecx
cmpl %ecx, %eax
jne 0x422de
movb $0x0, 0x472a1(%rip)     # 0x89575
movl $0x1, 0x4728e(%rip)     # 0x8956c
movb -0x2(%rbp), %al
movb %al, 0x4728d(%rip)      # 0x89574
movzbl 0x4727a(%rip), %eax     # 0x89568
addl 0x4727c(%rip), %eax     # 0x89570
movl %eax, 0x47276(%rip)     # 0x89570
jmp 0x424ab
cmpl $0x1, 0x47266(%rip)     # 0x8956c
jne 0x42437
movq 0x4724d(%rip), %rdi     # 0x89560
movl 0x47257(%rip), %esi     # 0x89570
movl $0x1, %edx
callq 0x424c0
movb %al, -0x1(%rbp)
movb 0x47249(%rip), %al      # 0x89575
addb $0x1, %al
movb %al, 0x47241(%rip)      # 0x89575
movl 0x47236(%rip), %eax     # 0x89570
addl $0x1, %eax
movl %eax, 0x4722d(%rip)     # 0x89570
movzbl -0x1(%rbp), %eax
cmpl $0x1, %eax
jne 0x423f3
movb 0x4721e(%rip), %al      # 0x89574
movb %al, -0x2(%rbp)
movzbl 0x47215(%rip), %eax     # 0x89575
cmpl $0xb, %eax
jne 0x423f1
movq 0x471f0(%rip), %rdi     # 0x89560
movl 0x471fa(%rip), %esi     # 0x89570
movl $0x6, %edx
callq 0x424c0
movb %al, 0x471ef(%rip)      # 0x89575
movl 0x471e4(%rip), %eax     # 0x89570
addl $0x6, %eax
movl %eax, 0x471db(%rip)     # 0x89570
movzbl 0x471d9(%rip), %eax     # 0x89575
cmpl $0x0, %eax
je 0x423ad
movl $0x2, 0x471c1(%rip)     # 0x8956c
jmp 0x423ef
movq 0x471ac(%rip), %rdi     # 0x89560
movl 0x471b6(%rip), %esi     # 0x89570
movzbl 0x471a7(%rip), %edx     # 0x89568
callq 0x424c0
movb %al, -0x2(%rbp)
movb -0x2(%rbp), %al
movb %al, 0x471a2(%rip)      # 0x89574
movzbl 0x4718f(%rip), %eax     # 0x89568
addl 0x47191(%rip), %eax     # 0x89570
movl %eax, 0x4718b(%rip)     # 0x89570
movl $0x0, 0x4717d(%rip)     # 0x8956c
jmp 0x423f1
jmp 0x42435
movq 0x47166(%rip), %rdi     # 0x89560
movl 0x47170(%rip), %esi     # 0x89570
movzbl 0x47161(%rip), %edx     # 0x89568
callq 0x424c0
movb %al, -0x2(%rbp)
movb -0x2(%rbp), %al
movb %al, 0x4715c(%rip)      # 0x89574
movzbl 0x47149(%rip), %eax     # 0x89568
addl 0x4714b(%rip), %eax     # 0x89570
movl %eax, 0x47145(%rip)     # 0x89570
movl $0x0, 0x47137(%rip)     # 0x8956c
jmp 0x424a9
cmpl $0x2, 0x4712e(%rip)     # 0x8956c
jne 0x424a7
movb 0x4712e(%rip), %al      # 0x89574
movb %al, -0x2(%rbp)
movb 0x47126(%rip), %al      # 0x89575
addb $-0x1, %al
movb %al, 0x4711e(%rip)      # 0x89575
movzbl 0x47117(%rip), %eax     # 0x89575
cmpl $0x0, %eax
jne 0x424a5
movq 0x470f6(%rip), %rdi     # 0x89560
movl 0x47100(%rip), %esi     # 0x89570
movzbl 0x470f1(%rip), %edx     # 0x89568
callq 0x424c0
movb %al, -0x2(%rbp)
movb -0x2(%rbp), %al
movb %al, 0x470ec(%rip)      # 0x89574
movzbl 0x470d9(%rip), %eax     # 0x89568
addl 0x470db(%rip), %eax     # 0x89570
movl %eax, 0x470d5(%rip)     # 0x89570
movl $0x0, 0x470c7(%rip)     # 0x8956c
jmp 0x424a7
jmp 0x424a9
jmp 0x424ab
movb -0x2(%rbp), %al
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)