// File: /workspace/github_c_makefile_star2_O2/robertdavidgraham[P]wc2/wc2.c
// Function: build_unicode
void build_unicode(unsigned char default_state, unsigned ubase)
{
    size_t i;

    build_basic(table[ubase + ILLEGAL], default_state, ubase);

    /*
     * Two byte
     */
    build_urow(ubase, DUO2_xx, 0);
    build_urow(ubase, DUO2_C2, 0);

    /*
     * Three byte
     */
    build_urow(ubase, TRI2_E0, TRI3_E0_xx);
    build_urow(ubase, TRI2_E1, TRI3_E1_xx);
    build_urow(ubase, TRI2_E2, TRI3_E2_xx);
    build_urow(ubase, TRI2_E3, TRI3_E3_xx);
    build_urow(ubase, TRI2_ED, TRI3_Ed_xx);
    build_urow(ubase, TRI2_EE, TRI3_Ee_xx);
    build_urow(ubase, TRI2_xx, TRI3_xx_xx);

    build_urow(ubase, TRI3_E0_xx, 0);
    build_urow(ubase, TRI3_E1_xx, 0);
    build_urow(ubase, TRI3_E1_9a, 0);
    build_urow(ubase, TRI3_E2_80, 0);
    build_urow(ubase, TRI3_E2_81, 0);
    build_urow(ubase, TRI3_E2_xx, 0);
    build_urow(ubase, TRI3_E3_80, 0);
    build_urow(ubase, TRI3_E3_81, 0);
    build_urow(ubase, TRI3_E3_xx, 0);
    build_urow(ubase, TRI3_Ed_xx, 0);
    build_urow(ubase, TRI3_Ee_xx, 0);
    build_urow(ubase, TRI3_xx_xx, 0);

    table[ubase + TRI2_E1][0x9a] = ubase + TRI3_E1_9a;
    table[ubase + TRI2_E2][0x80] = ubase + TRI3_E2_80;
    table[ubase + TRI2_E2][0x81] = ubase + TRI3_E2_81;
    table[ubase + TRI2_E3][0x80] = ubase + TRI3_E3_80;
    table[ubase + TRI2_E3][0x81] = ubase + TRI3_E3_81;


    /*
     * Four byte
     */
    build_urow(ubase, QUAD2_xx, QUAD3_xx_xx);
    build_urow(ubase, QUAD2_F0, QUAD3_F0_xx);
    build_urow(ubase, QUAD2_F4, QUAD3_F4_xx);

    build_urow(ubase, QUAD3_xx_xx, QUAD4_xx_xx_xx);
    build_urow(ubase, QUAD3_F0_xx, QUAD4_F0_xx_xx);
    build_urow(ubase, QUAD3_F4_xx, QUAD4_F4_xx_xx);

    build_urow(ubase, QUAD4_xx_xx_xx, 0);
    build_urow(ubase, QUAD4_F0_xx_xx, 0);
    build_urow(ubase, QUAD4_F4_xx_xx, 0);

    /*
     * Mark Unicode spaces
     */
    if (iswspace(0x0085))
        table[ubase + DUO2_C2][0x85] = WASSPACE;
    if (iswspace(0x00A0))
        table[ubase + DUO2_C2][0xA0] = WASSPACE;
    if (iswspace(0x1680)) /* 0x1680 = 0xe1 0x9a 0x80 = OGHAM SPACE MARK*/
        table[ubase + TRI3_E1_9a][0x80] = WASSPACE;
    for (i=0x2000; i<0x200b+1; i++) {
        if (iswspace(i))
            table[ubase + TRI3_E2_80][0x80 + (i&0x6F)] = WASSPACE;
    }
    if (iswspace(0x2028))
        table[ubase + TRI3_E2_80][0xA8] = WASSPACE;
    if (iswspace(0x2029))
        table[ubase + TRI3_E2_80][0xA9] = WASSPACE;
    if (iswspace(0x202F))
        table[ubase + TRI3_E2_80][0xAF] = WASSPACE;
    if (iswspace(0x205F))
        table[ubase + TRI3_E2_81][0x9F] = WASSPACE;
    if (iswspace(0x3000))
        table[ubase + TRI3_E3_80][0x80] = WASSPACE;


    /*
     * Mark illegal sequences
     *
     * The following need to be marked as illegal because they can
     * be represented with a shorter string. In other words,
     * 0xC0 0x81 is the same as 0x01, so needs to be marked as an
     * illegal sequence.
     */
    for (i=0x80; i<0xA0; i++) {
        table[ubase + TRI2_E0][i] = ubase + ILLEGAL;
    }
    for (i=0x80; i<0x90; i++) {
        table[ubase + QUAD2_F0][i] = ubase + ILLEGAL;
    }
    /* Exceeds max possible size of unicode character */
    for (i=0x90; i<0xC0; i++) {
        table[ubase + QUAD2_F4][i] = ubase + ILLEGAL;
    }
    /* Surrogate space */
    for (i=0xA0; i<0xC0; i++) {
        table[ubase + TRI2_ED][i] = ubase + ILLEGAL;
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movl %edi, %esi
leal 0x1e(%rbx), %r13d
movq %r13, %rdi
shlq $0x8, %rdi
leaq 0x3bf8(%rip), %rax      # 0x50f0
addq %rax, %rdi
movzbl %bl, %ebp
movl %ebp, %edx
callq 0x12a4
movl %ebx, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1454
pushq $0x1
popq %rsi
movl %ebx, %edi
xorl %edx, %edx
callq 0x1454
pushq $0x2
popq %rsi
pushq $0x9
popq %r15
movl %ebx, %edi
movl %r15d, %edx
callq 0x1454
pushq $0x3
popq %rsi
pushq $0xa
popq %r12
movl %ebx, %edi
movl %r12d, %edx
callq 0x1454
pushq $0x4
popq %rsi
pushq $0xe
popq %r14
movl %ebx, %edi
movl %r14d, %edx
callq 0x1454
pushq $0x5
popq %rsi
pushq $0x11
popq %rdx
movl %ebx, %edi
callq 0x1454
pushq $0x6
popq %rsi
pushq $0x12
popq %rdx
movl %ebx, %edi
callq 0x1454
pushq $0x7
popq %rsi
pushq $0x13
popq %rdx
movl %ebx, %edi
callq 0x1454
pushq $0x8
popq %rsi
pushq $0x14
popq %rdx
movl %ebx, %edi
callq 0x1454
movl %ebx, %edi
movl %r15d, %esi
xorl %edx, %edx
callq 0x1454
movl %ebx, %edi
movl %r12d, %esi
xorl %edx, %edx
callq 0x1454
pushq $0xb
popq %rsi
movl %ebx, %edi
xorl %edx, %edx
callq 0x1454
pushq $0xc
popq %rsi
movl %ebx, %edi
xorl %edx, %edx
callq 0x1454
pushq $0xd
popq %rsi
movl %ebx, %edi
xorl %edx, %edx
callq 0x1454
movl %ebx, %edi
movl %r14d, %esi
xorl %edx, %edx
callq 0x1454
pushq $0xf
popq %rsi
movl %ebx, %edi
xorl %edx, %edx
callq 0x1454
pushq $0x10
popq %rsi
movl %ebx, %edi
xorl %edx, %edx
callq 0x1454
movl %ebx, %edi
pushq $0x11
popq %rsi
xorl %edx, %edx
callq 0x1454
movl %ebx, %edi
pushq $0x12
popq %rsi
xorl %edx, %edx
callq 0x1454
movl %ebx, %edi
pushq $0x13
popq %rsi
xorl %edx, %edx
callq 0x1454
movl %ebx, %edi
pushq $0x14
popq %rsi
xorl %edx, %edx
callq 0x1454
leal 0xb(%rbx), %edx
leal 0x3(%rbx), %eax
shlq $0x8, %rax
leaq 0x3acc(%rip), %rcx      # 0x50f0
movl %edx, 0x8(%rsp)
movb %dl, 0x9a(%rax,%rcx)
leal 0xc(%rbx), %edx
leal 0x4(%rbx), %eax
shlq $0x8, %rax
movl %edx, 0x14(%rsp)
movb %dl, 0x80(%rax,%rcx)
leal 0xd(%rbx), %edx
movl %edx, 0xc(%rsp)
movb %dl, 0x81(%rax,%rcx)
leal 0xf(%rbx), %edx
leal 0x5(%rbx), %eax
shlq $0x8, %rax
movl %edx, 0x10(%rsp)
movb %dl, 0x80(%rax,%rcx)
addb $0x10, %bpl
movb %bpl, 0x81(%rax,%rcx)
pushq $0x15
popq %rsi
pushq $0x18
popq %rbp
movl %ebx, %edi
movl %ebp, %edx
callq 0x1454
pushq $0x16
popq %rsi
pushq $0x19
popq %r14
movl %ebx, %edi
movl %r14d, %edx
callq 0x1454
pushq $0x17
popq %rsi
pushq $0x1a
popq %r15
movl %ebx, %edi
movl %r15d, %edx
callq 0x1454
pushq $0x1b
popq %r12
movl %ebx, %edi
movl %ebp, %esi
movl %r12d, %edx
callq 0x1454
pushq $0x1c
popq %rbp
movl %ebx, %edi
movl %r14d, %esi
movl %ebp, %edx
callq 0x1454
pushq $0x1d
popq %r14
movl %ebx, %edi
movl %r15d, %esi
movl %r14d, %edx
callq 0x1454
movl %ebx, %edi
movl %r12d, %esi
xorl %edx, %edx
callq 0x1454
movl %ebx, %edi
movl %ebp, %esi
leaq 0x3a05(%rip), %rbp      # 0x50f0
xorl %edx, %edx
callq 0x1454
movl %ebx, %edi
movl %r14d, %esi
xorl %edx, %edx
callq 0x1454
movl $0x85, %edi
callq 0x1140
testl %eax, %eax
je 0x171b
leal 0x1(%rbx), %eax
shlq $0x8, %rax
movb $0x0, 0x85(%rax,%rbp)
movl $0xa0, %edi
callq 0x1140
testl %eax, %eax
je 0x1738
leal 0x1(%rbx), %eax
shlq $0x8, %rax
movb $0x0, 0xa0(%rax,%rbp)
movl $0x1680, %edi           # imm = 0x1680
callq 0x1140
testl %eax, %eax
je 0x1756
movl 0x8(%rsp), %eax
shlq $0x8, %rax
movb $0x0, 0x80(%rax,%rbp)
movl 0x14(%rsp), %r15d
movl $0x2000, %r14d          # imm = 0x2000
shlq $0x8, %r15
leaq (%r15,%rbp), %r12
cmpq $0x200c, %r14           # imm = 0x200C
je 0x1792
movl %r14d, %edi
callq 0x1140
testl %eax, %eax
je 0x178d
movl %r14d, %eax
andl $0x6f, %eax
movb $0x0, 0x80(%rax,%r12)
incq %r14
jmp 0x1769
movl $0x2028, %edi           # imm = 0x2028
callq 0x1140
testl %eax, %eax
je 0x17a9
movb $0x0, 0xa8(%r15,%rbp)
movl $0x2029, %edi           # imm = 0x2029
callq 0x1140
testl %eax, %eax
je 0x17c0
movb $0x0, 0xa9(%r15,%rbp)
movl $0x202f, %edi           # imm = 0x202F
callq 0x1140
testl %eax, %eax
je 0x17d7
movb $0x0, 0xaf(%r15,%rbp)
movl $0x205f, %edi           # imm = 0x205F
callq 0x1140
testl %eax, %eax
je 0x17f5
movl 0xc(%rsp), %eax
shlq $0x8, %rax
movb $0x0, 0x9f(%rax,%rbp)
movl $0x3000, %edi           # imm = 0x3000
callq 0x1140
testl %eax, %eax
je 0x1813
movl 0x10(%rsp), %eax
shlq $0x8, %rax
movb $0x0, 0x80(%rax,%rbp)
leal 0x2(%rbx), %eax
shlq $0x8, %rax
addq %rbp, %rax
addq $0x80, %rax
xorl %ecx, %ecx
cmpq $0x20, %rcx
je 0x1834
movb %r13b, (%rax,%rcx)
incq %rcx
jmp 0x1825
leal 0x16(%rbx), %eax
shlq $0x8, %rax
addq %rbp, %rax
addq $0x80, %rax
xorl %ecx, %ecx
cmpq $0x10, %rcx
je 0x1855
movb %r13b, (%rax,%rcx)
incq %rcx
jmp 0x1846
leal 0x17(%rbx), %eax
shlq $0x8, %rax
addq %rbp, %rax
addq $0x90, %rax
pushq $-0x30
popq %rcx
testq %rcx, %rcx
je 0x1877
movb %r13b, 0x30(%rax,%rcx)
incq %rcx
jmp 0x1868
addl $0x6, %ebx
shlq $0x8, %rbx
leaq (%rbx,%rbp), %rax
addq $0xa0, %rax
xorl %ecx, %ecx
cmpq $0x20, %rcx
je 0x1899
movb %r13b, (%rax,%rcx)
incq %rcx
jmp 0x188a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq