// File: /workspace/github_c_makefile_star2_O0/goghcrow[P]dubbo_ab/lib/utf8_decode.c
// Function: utf8_decode_next
int utf8_decode_next() {
    int c;  /* the first byte of the character */
    int c1; /* the first continuation character */
    int c2; /* the second continuation character */
    int c3; /* the third continuation character */
    int r;  /* the result */

    if (the_index >= the_length) {
        return the_index == the_length ? UTF8_END : UTF8_ERROR;
    }
    the_byte = the_index;
    the_char += 1;
    c = get();
/*
    Zero continuation (0 to 127)
*/
    if ((c & 0x80) == 0) {
        return c;
    }
/*
    One continuation (128 to 2047)
*/
    if ((c & 0xE0) == 0xC0) {
        c1 = cont();
        if (c1 >= 0) {
            r = ((c & 0x1F) << 6) | c1;
            if (r >= 128) {
                return r;
            }
        }

/*
    Two continuations (2048 to 55295 and 57344 to 65535)
*/
    } else if ((c & 0xF0) == 0xE0) {
        c1 = cont();
        c2 = cont();
        if ((c1 | c2) >= 0) {
            r = ((c & 0x0F) << 12) | (c1 << 6) | c2;
            if (r >= 2048 && (r < 55296 || r > 57343)) {
                return r;
            }
        }

/*
    Three continuations (65536 to 1114111)
*/
    } else if ((c & 0xF8) == 0xF0) {
        c1 = cont();
        c2 = cont();
        c3 = cont();
        if ((c1 | c2 | c3) >= 0) {
            r = ((c & 0x07) << 18) | (c1 << 12) | (c2 << 6) | c3;
            if (r >= 65536 && r <= 1114111) {
                return r;
            }
        }
    }
    return UTF8_ERROR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl 0x11a6a(%rip), %eax     # 0x15238
cmpl 0x11a74(%rip), %eax     # 0x15248
jl 0x37f9
movl 0x11a5c(%rip), %edx     # 0x15238
movl 0x11a66(%rip), %esi     # 0x15248
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl %esi, %edx
cmovel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x3963
movl 0x11a39(%rip), %eax     # 0x15238
movl %eax, 0x11a4b(%rip)     # 0x15250
movl 0x11a41(%rip), %eax     # 0x1524c
addl $0x1, %eax
movl %eax, 0x11a38(%rip)     # 0x1524c
callq 0x3970
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
jne 0x3834
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x3963
movl -0x8(%rbp), %eax
andl $0xe0, %eax
cmpl $0xc0, %eax
jne 0x387b
callq 0x39c0
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x3876
movl -0x8(%rbp), %eax
andl $0x1f, %eax
shll $0x6, %eax
orl -0xc(%rbp), %eax
movl %eax, -0x18(%rbp)
cmpl $0x80, -0x18(%rbp)
jl 0x3874
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x3963
jmp 0x3876
jmp 0x395c
movl -0x8(%rbp), %eax
andl $0xf0, %eax
cmpl $0xe0, %eax
jne 0x38e6
callq 0x39c0
movl %eax, -0xc(%rbp)
callq 0x39c0
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
orl -0x10(%rbp), %eax
cmpl $0x0, %eax
jl 0x38e4
movl -0x8(%rbp), %eax
andl $0xf, %eax
shll $0xc, %eax
movl -0xc(%rbp), %ecx
shll $0x6, %ecx
orl %ecx, %eax
orl -0x10(%rbp), %eax
movl %eax, -0x18(%rbp)
cmpl $0x800, -0x18(%rbp)     # imm = 0x800
jl 0x38e2
cmpl $0xd800, -0x18(%rbp)    # imm = 0xD800
jl 0x38d7
cmpl $0xdfff, -0x18(%rbp)    # imm = 0xDFFF
jle 0x38e2
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x3963
jmp 0x38e4
jmp 0x395a
movl -0x8(%rbp), %eax
andl $0xf8, %eax
cmpl $0xf0, %eax
jne 0x3958
callq 0x39c0
movl %eax, -0xc(%rbp)
callq 0x39c0
movl %eax, -0x10(%rbp)
callq 0x39c0
movl %eax, -0x14(%rbp)
movl -0xc(%rbp), %eax
orl -0x10(%rbp), %eax
orl -0x14(%rbp), %eax
cmpl $0x0, %eax
jl 0x3956
movl -0x8(%rbp), %eax
andl $0x7, %eax
shll $0x12, %eax
movl -0xc(%rbp), %ecx
shll $0xc, %ecx
orl %ecx, %eax
movl -0x10(%rbp), %ecx
shll $0x6, %ecx
orl %ecx, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
cmpl $0x10000, -0x18(%rbp)   # imm = 0x10000
jl 0x3954
cmpl $0x10ffff, -0x18(%rbp)  # imm = 0x10FFFF
jg 0x3954
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x3963
jmp 0x3956
jmp 0x3958
jmp 0x395a
jmp 0x395c
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)