// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/cm256/gf256.cpp
// Function: gf256_init_
int gf256_init_(int version)
{
    if (version != GF256_VERSION)
        return -1; // User's header does not match library version.

    // Avoid multiple initialization
    if (Initialized)
        return 0;
    Initialized = true;

    if (!IsLittleEndian())
        return -2; // Architecture is not supported (code won't work without mods).

    gf256_architecture_init();
    gf256_poly_init(kDefaultPolynomialIndex);
    gf256_explog_init();
    gf256_muldiv_init();
    gf256_inv_init();
    gf256_sqr_init();
    gf256_mul_mem_init();

    if (!gf256_self_test())
        return -3; // Self-test failed (perhaps untested configuration)

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpl $0x2, %edi
jne 0x9bc9
xorl %r14d, %r14d
cmpb $0x0, 0x28f49(%rip)     # 0x32b10
je 0x9bdb
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %sil
movb %sil, 0x28f2b(%rip)     # 0x32b10
movl $0x1, %eax
xorl %ecx, %ecx
xchgq %rbx, %rdi
cpuid
xchgq %rbx, %rdi
shrl $0x9, %ecx
andb %sil, %cl
movb %cl, 0x28f11(%rip)      # 0x32b11
movl $0x14d, 0x28efa(%rip)   # imm = 0x14D
movw $0x200, 0x288ed(%rip)   # imm = 0x200
movb %sil, 0x28ae6(%rip)     # 0x32700
movq $-0xfe, %rax
movl $0x14d, %ecx            # imm = 0x14D
leaq 0x66d3(%rip), %r15      # 0x10300
movl $0xff, %edx
movzbl %sil, %edi
testb %dil, %dil
movl $0x0, %esi
cmovsl %ecx, %esi
addl %edi, %edi
xorl %edi, %esi
movb %sil, 0x224ff(%rax,%r15)
movl %esi, %edi
andl %edx, %edi
leal (%rax,%rdx), %r8d
movw %r8w, 0x22200(%r15,%rdi,2)
incq %rax
jne 0x9c32
movb $0x1, 0x28b95(%rip)     # 0x327ff
movw $0xff, 0x2888f(%rip)    # 0x32502
movq $-0xfe, %rax
movb 0x224ff(%rax,%r15), %cl
movb %cl, 0x225fe(%rax,%r15)
incq %rax
jne 0x9c7a
movb $0x1, 0x28c68(%rip)     # 0x328fe
leaq 0x28c62(%rip), %rdi     # 0x328ff
xorl %r12d, %r12d
movl $0x1fd, %edx            # imm = 0x1FD
xorl %esi, %esi
callq 0x2180
leaq 0x864d(%rip), %rbx      # 0x12300
movl $0x100, %r13d           # imm = 0x100
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2180
leaq 0x18631(%rip), %r14     # 0x22300
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x2180
movl $0x1, %eax
leaq 0x18717(%rip), %rcx     # 0x22401
leaq 0x28a0f(%rip), %rdx     # 0x32700
movzbl 0x22200(%r15,%rax,2), %esi
movb %r12b, 0x100(%rbx)
addq %r13, %rbx
movb %r12b, 0x100(%r14)
addq %r13, %r14
movl %esi, %edi
xorl $0xff, %edi
movl %edi, %edi
xorl %r8d, %r8d
movzwl 0x22202(%r15,%r8,2), %r9d
leaq (%r9,%rsi), %r10
movb (%rdx,%r10), %r10b
movb %r10b, -0x10000(%rcx,%r8)
addq %rdi, %r9
movb (%rdx,%r9), %r9b
movb %r9b, (%rcx,%r8)
incq %r8
cmpq $0xff, %r8
jne 0x9d1b
incq %rax
addq %r13, %rcx
cmpq %r13, %rax
jne 0x9cf1
movq $-0x10000, %rax         # imm = 0xFFFF0000
leaq 0x2859c(%rip), %rcx     # 0x32300
movb 0x22001(%rax,%r15), %dl
movb %dl, (%rcx)
incq %rcx
addq $0x100, %rax            # imm = 0x100
jne 0x9d64
movq $-0x10100, %rax         # imm = 0xFFFEFF00
leaq 0x28679(%rip), %rcx     # 0x32400
movb 0x12100(%rax,%r15), %dl
movb %dl, (%rcx)
incq %rcx
addq $0x101, %rax            # imm = 0x101
jne 0x9d87
leaq 0x855d(%rip), %rax      # 0x12300
xorl %ecx, %ecx
leaq 0x28d74(%rip), %rbx     # 0x32b20
movl $0x100, %edx            # imm = 0x100
movq %rcx, %rsi
shlq $0x8, %rsi
movdqa 0x2000(%rsi,%r15), %xmm0
movdqa %xmm0, 0x28d56(%rip)    # 0x32b20
movq %rax, %rsi
xorl %edi, %edi
movb (%rsi), %r8b
movb %r8b, 0x40(%rdi,%rbx)
incq %rdi
addq $0x10, %rsi
cmpq $0x10, %rdi
jne 0x9dcf
movdqa 0x28d34(%rip), %xmm0    # 0x32b20
movaps 0x28d6d(%rip), %xmm1    # 0x32b60
movq %rcx, %rsi
shlq $0x4, %rsi
movdqa %xmm0, (%rsi,%r15)
movaps %xmm1, 0x1000(%rsi,%r15)
incq %rcx
addq %rdx, %rax
cmpq %rdx, %rcx
jne 0x9db1
leaq 0x84e5(%rip), %rax      # 0x12300
xorl %ecx, %ecx
movq %rcx, %rdx
shlq $0x8, %rdx
xorl %esi, %esi
xorl %edi, %edi
testq %rcx, %rcx
sete %r9b
movzbl (%rax,%rsi), %r8d
testq %rsi, %rsi
sete %r10b
orb %r9b, %r10b
jne 0x9e75
movq %rdx, %r9
orq %r8, %r9
movzbl 0x12000(%r15,%r9), %r9d
movl $0xfffffffd, %r14d      # imm = 0xFFFFFFFD
cmpq %r9, %rdi
jne 0x9bc9
leaq (%r15,%r8), %r9
movzbl 0x12000(%rsi,%r9), %r9d
cmpq %r9, %rcx
je 0x9e81
jmp 0x9bc9
testq %r8, %r8
jne 0xa1c1
xorl %r8d, %r8d
movl $0xfffffffd, %r14d      # imm = 0xFFFFFFFD
cmpq $0x100, %rsi            # imm = 0x100
jne 0x9e99
cmpq %r8, %rcx
jne 0x9bc9
incq %rdi
addq $0x100, %rsi            # imm = 0x100
cmpq $0x10000, %rsi          # imm = 0x10000
jne 0x9e28
incq %rcx
incq %rax
cmpq $0x100, %rcx            # imm = 0x100
jne 0x9e1d
movb $0x5a, %al
movb %al, 0x28c94(%rip)      # 0x32b5f
movb %al, 0x28cce(%rip)      # 0x32b9f
movb %al, 0x28d08(%rip)      # 0x32bdf
movaps 0x2232(%rip), %xmm0     # 0xc110
movaps %xmm0, 0x28c3b(%rip)    # 0x32b20
movaps %xmm0, 0x28c44(%rip)    # 0x32b30
movaps %xmm0, 0x28c4d(%rip)    # 0x32b40
movups %xmm0, 0x28c55(%rip)    # 0x32b4f
movdqa 0x221e(%rip), %xmm0     # 0xc120
movdqa %xmm0, 0x28c56(%rip)    # 0x32b60
movdqa %xmm0, 0x28c5e(%rip)    # 0x32b70
movdqa %xmm0, 0x28c66(%rip)    # 0x32b80
movdqu %xmm0, 0x28c6d(%rip)    # 0x32b8f
leaq 0x28c37(%rip), %rsi     # 0x32b60
movq %rbx, %rdi
movl $0x3f, %edx
callq 0xa1cc
xorl %eax, %eax
cmpb $-0x18, (%rax,%rbx)
jne 0x9bc9
incq %rax
cmpq $0x3f, %rax
jne 0x9f38
movaps 0x21be(%rip), %xmm0     # 0xc110
movups %xmm0, 0x28bf6(%rip)    # 0x32b4f
movaps %xmm0, 0x28be0(%rip)    # 0x32b40
movaps %xmm0, 0x28bc9(%rip)    # 0x32b30
movaps %xmm0, 0x28bb2(%rip)    # 0x32b20
movaps 0x21ab(%rip), %xmm0     # 0xc120
movaps %xmm0, 0x28be4(%rip)    # 0x32b60
movaps %xmm0, 0x28bed(%rip)    # 0x32b70
movaps %xmm0, 0x28bf6(%rip)    # 0x32b80
movups %xmm0, 0x28bfe(%rip)    # 0x32b8f
leaq 0x28bc8(%rip), %rsi     # 0x32b60
movdqa 0x2190(%rip), %xmm0     # 0xc130
movdqa %xmm0, 0x28bf8(%rip)    # 0x32ba0
movdqa %xmm0, 0x28c00(%rip)    # 0x32bb0
movdqa %xmm0, 0x28c08(%rip)    # 0x32bc0
movdqu %xmm0, 0x28c0f(%rip)    # 0x32bcf
leaq 0x28bd9(%rip), %rdx     # 0x32ba0
movq %rbx, %rdi
movl $0x3f, %ecx
callq 0xa297
xorl %eax, %eax
cmpb $-0x67, (%rax,%rbx)
jne 0x9bc9
incq %rax
cmpq $0x3f, %rax
jne 0x9fd6
movaps 0x2150(%rip), %xmm0     # 0xc140
movups %xmm0, 0x28b58(%rip)    # 0x32b4f
movaps %xmm0, 0x28b42(%rip)    # 0x32b40
movaps %xmm0, 0x28b2b(%rip)    # 0x32b30
movaps %xmm0, 0x28b14(%rip)    # 0x32b20
movaps 0x213d(%rip), %xmm0     # 0xc150
movaps %xmm0, 0x28b46(%rip)    # 0x32b60
movaps %xmm0, 0x28b4f(%rip)    # 0x32b70
movaps %xmm0, 0x28b58(%rip)    # 0x32b80
movups %xmm0, 0x28b60(%rip)    # 0x32b8f
leaq 0x28b2a(%rip), %rsi     # 0x32b60
movdqa 0x2122(%rip), %xmm0     # 0xc160
movdqa %xmm0, 0x28b5a(%rip)    # 0x32ba0
movdqa %xmm0, 0x28b62(%rip)    # 0x32bb0
movdqa %xmm0, 0x28b6a(%rip)    # 0x32bc0
movdqu %xmm0, 0x28b71(%rip)    # 0x32bcf
leaq 0x28b3b(%rip), %rdx     # 0x32ba0
movq %rbx, %rdi
movl $0x3f, %ecx
callq 0xa331
xorl %eax, %eax
cmpb $-0x3a, (%rax,%rbx)
jne 0x9bc9
incq %rax
cmpq $0x3f, %rax
jne 0xa074
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x28abc(%rip)    # 0x32b4f
movdqa %xmm0, 0x28aa5(%rip)    # 0x32b40
movdqa %xmm0, 0x28a8d(%rip)    # 0x32b30
movdqa %xmm0, 0x28a75(%rip)    # 0x32b20
movdqa 0x209d(%rip), %xmm0     # 0xc150
movdqa %xmm0, 0x28aa5(%rip)    # 0x32b60
movdqa %xmm0, 0x28aad(%rip)    # 0x32b70
movdqa %xmm0, 0x28ab5(%rip)    # 0x32b80
movdqu %xmm0, 0x28abc(%rip)    # 0x32b8f
leaq 0x28a86(%rip), %rdx     # 0x32b60
movb 0xeec9(%rip), %r15b     # 0x18faa
movq %rbx, %rdi
movl $0x6c, %esi
movl $0x3f, %ecx
callq 0xa614
xorl %eax, %eax
movb (%rax,%rbx), %cl
xorb %r15b, %cl
cmpb $-0x1, %cl
jne 0x9bc9
incq %rax
cmpq $0x3f, %rax
jne 0xa0f5
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x28a36(%rip)    # 0x32b4f
movdqa %xmm0, 0x28a1f(%rip)    # 0x32b40
movdqa %xmm0, 0x28a07(%rip)    # 0x32b30
movdqa %xmm0, 0x289ef(%rip)    # 0x32b20
movdqa 0x2007(%rip), %xmm0     # 0xc140
movdqa %xmm0, 0x28a1f(%rip)    # 0x32b60
movdqa %xmm0, 0x28a27(%rip)    # 0x32b70
movdqa %xmm0, 0x28a2f(%rip)    # 0x32b80
movdqu %xmm0, 0x28a36(%rip)    # 0x32b8f
leaq 0x28a00(%rip), %rsi     # 0x32b60
movb 0xd73b(%rip), %r15b     # 0x178a2
movq %rbx, %rdi
movl $0xa2, %edx
movl $0x3f, %ecx
callq 0xa41e
xorl %eax, %eax
cmpb %r15b, (%rax,%rbx)
jne 0x9bc9
incq %rax
cmpq $0x3f, %rax
jne 0xa17b
cmpb $0x5a, 0x289ca(%rip)    # 0x32b5f
jne 0x9bc9
cmpb $0x5a, 0x289fd(%rip)    # 0x32b9f
jne 0x9bc9
xorl %eax, %eax
cmpb $0x5a, 0x28a2e(%rip)    # 0x32bdf
sete %al
leal (%rax,%rax,2), %r14d
addl $-0x3, %r14d
jmp 0x9bc9
movl $0xfffffffd, %r14d      # imm = 0xFFFFFFFD
jmp 0x9bc9