// File: /workspace/github_cpp_makefile_star2_O1/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, %ebx       # imm = 0xFFFFFFFF
cmpl $0x2, %edi
jne 0xa44a
xorl %ebx, %ebx
cmpb $0x0, 0x28d4f(%rip)     # 0x32b10
jne 0xa44a
movb $0x1, %dil
movb %dil, 0x28d3f(%rip)     # 0x32b10
xorl %esi, %esi
xorl %ecx, %ecx
movl $0x1, %eax
xchgq %rbx, %r8
cpuid
xchgq %rbx, %r8
shrl $0x9, %ecx
andb %dil, %cl
movb %cl, 0x28d23(%rip)      # 0x32b11
movl $0x14d, 0x28d0c(%rip)   # imm = 0x14D
movw $0x200, 0x286ff(%rip)   # imm = 0x200
movb %dil, 0x288f8(%rip)     # 0x32700
leaq 0x64f1(%rip), %r15      # 0x10300
movl $0x14d, %eax            # imm = 0x14D
movzbl 0x22400(%rsi,%r15), %ecx
movl %ecx, %edx
addl %ecx, %edx
testb %cl, %cl
movl $0x0, %ecx
cmovsl %eax, %ecx
xorl %edx, %ecx
movb %cl, 0x22401(%rsi,%r15)
incq %rsi
movzbl %cl, %ecx
movw %si, 0x22200(%r15,%rcx,2)
cmpq $0xfe, %rsi
jne 0x9e14
movb $0x1, 0x289ab(%rip)     # 0x327ff
movw $0xff, 0x286a5(%rip)    # 0x32502
movl $0x100, %ecx            # imm = 0x100
xorl %esi, %esi
movabsq $-0x7f7f7f7f7f7f7f7f, %rdi # imm = 0x8080808080808081
movq %rcx, %rax
mulq %rdi
shrq $0x7, %rdx
movq %rdx, %rax
shlq $0x8, %rax
subq %rax, %rdx
leaq (%rsi,%r15), %rax
addq $0x22500, %rax          # imm = 0x22500
movb (%rax,%rdx), %dl
movb %dl, (%rax)
incq %rcx
incq %rsi
cmpq $0xfe, %rsi
jne 0x9e6e
movb $0x1, 0x28a57(%rip)     # 0x328fe
leaq 0x28a51(%rip), %rdi     # 0x328ff
xorl %r12d, %r12d
movl $0x1fd, %edx            # imm = 0x1FD
xorl %esi, %esi
callq 0x2180
leaq 0x843c(%rip), %rbx      # 0x12300
movl $0x100, %r13d           # imm = 0x100
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2180
leaq 0x18420(%rip), %r14     # 0x22300
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x2180
movl $0x1, %eax
leaq 0x18506(%rip), %rcx     # 0x22401
leaq 0x287fe(%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 0x9f2c
incq %rax
addq %r13, %rcx
cmpq %r13, %rax
jne 0x9f02
movq $-0x10000, %rax         # imm = 0xFFFF0000
leaq 0x2838b(%rip), %rcx     # 0x32300
movb 0x22001(%rax,%r15), %dl
movb %dl, (%rcx)
incq %rcx
addq $0x100, %rax            # imm = 0x100
jne 0x9f75
movq $-0x10100, %rax         # imm = 0xFFFEFF00
leaq 0x28468(%rip), %rcx     # 0x32400
movb 0x12100(%rax,%r15), %dl
movb %dl, (%rcx)
incq %rcx
addq $0x101, %rax            # imm = 0x101
jne 0x9f98
leaq 0x834c(%rip), %rax      # 0x12300
xorl %ecx, %ecx
leaq 0x28b63(%rip), %rdx     # 0x32b20
movl $0x100, %esi            # imm = 0x100
movq %rcx, %rdi
shlq $0x8, %rdi
movdqa 0x2000(%rdi,%r15), %xmm0
movdqa %xmm0, 0x28b45(%rip)    # 0x32b20
movq %rax, %rdi
xorl %r8d, %r8d
movb (%rdi), %r9b
movb %r9b, 0x40(%r8,%rdx)
incq %r8
addq $0x10, %rdi
cmpq $0x10, %r8
jne 0x9fe1
movdqa 0x28b22(%rip), %xmm0    # 0x32b20
movaps 0x28b5b(%rip), %xmm1    # 0x32b60
movq %rcx, %rdi
shlq $0x4, %rdi
movdqa %xmm0, (%rdi,%r15)
movaps %xmm1, 0x1000(%rdi,%r15)
incq %rcx
addq %rsi, %rax
cmpq %rsi, %rcx
jne 0x9fc2
leaq 0x82d3(%rip), %rax      # 0x12300
xorl %ecx, %ecx
xorl %edx, %edx
movq %rcx, %rsi
shlq $0x8, %rsi
xorl %edi, %edi
xorl %r9d, %r9d
xorl %r8d, %r8d
testq %rcx, %rcx
sete %r11b
movzbl (%rax,%rdi), %r10d
testq %rdi, %rdi
sete %bl
orb %r11b, %bl
jne 0xa07f
movq %rsi, %r11
orq %r10, %r11
movzbl 0x12000(%r15,%r11), %r11d
cmpq %r11, %r9
jne 0xa0b3
leaq (%r15,%r10), %r11
movzbl 0x12000(%rdi,%r11), %r11d
cmpq %r11, %rcx
je 0xa084
jmp 0xa0b3
testq %r10, %r10
jne 0xa0b3
cmpq $0x100, %rdi            # imm = 0x100
jne 0xa092
cmpq %r10, %rcx
jne 0xa0b3
cmpq $0xff, %r9
leaq 0x1(%r9), %r9
setae %r8b
addq $0x100, %rdi            # imm = 0x100
cmpq $0x10000, %rdi          # imm = 0x10000
jne 0xa040
jmp 0xa0b9
testb $0x1, %r8b
je 0xa0dc
cmpq $0xff, %rcx
leaq 0x1(%rcx), %rsi
setae %dl
incq %rax
movq %rsi, %rcx
cmpq $0x100, %rsi            # imm = 0x100
jne 0xa031
jmp 0xa0ea
movl $0xfffffffd, %ebx       # imm = 0xFFFFFFFD
testb $0x1, %dl
je 0xa44a
movb $0x5a, %al
movb %al, 0x28a6d(%rip)      # 0x32b5f
leaq 0x28a27(%rip), %r14     # 0x32b20
movb %al, 0x28aa0(%rip)      # 0x32b9f
movb %al, 0x28ada(%rip)      # 0x32bdf
movaps 0x2004(%rip), %xmm0     # 0xc110
movaps %xmm0, 0x28a0d(%rip)    # 0x32b20
movaps %xmm0, 0x28a16(%rip)    # 0x32b30
movaps %xmm0, 0x28a1f(%rip)    # 0x32b40
movups %xmm0, 0x28a27(%rip)    # 0x32b4f
movdqa 0x1ff0(%rip), %xmm0     # 0xc120
movdqa %xmm0, 0x28a28(%rip)    # 0x32b60
movdqa %xmm0, 0x28a30(%rip)    # 0x32b70
movdqa %xmm0, 0x28a38(%rip)    # 0x32b80
movdqu %xmm0, 0x28a3f(%rip)    # 0x32b8f
leaq 0x28a09(%rip), %rsi     # 0x32b60
movq %r14, %rdi
movl $0x3f, %edx
callq 0xa45b
movl $0xfffffffd, %ebx       # imm = 0xFFFFFFFD
cmpb $-0x18, 0x289b0(%rip)   # 0x32b20
jne 0xa44a
movq $-0x1, %rax
cmpq $0x3d, %rax
je 0xa19c
leaq 0x1(%rax), %rcx
cmpb $-0x18, 0x2(%rax,%r14)
movq %rcx, %rax
je 0xa17d
cmpq $0x3e, %rcx
jb 0xa44a
movaps 0x1f6d(%rip), %xmm0     # 0xc110
movups %xmm0, 0x289a5(%rip)    # 0x32b4f
movaps %xmm0, 0x2898f(%rip)    # 0x32b40
movaps %xmm0, 0x28978(%rip)    # 0x32b30
movaps %xmm0, 0x28961(%rip)    # 0x32b20
leaq 0x2895a(%rip), %r14     # 0x32b20
movaps 0x1f53(%rip), %xmm0     # 0xc120
movaps %xmm0, 0x2898c(%rip)    # 0x32b60
movaps %xmm0, 0x28995(%rip)    # 0x32b70
movaps %xmm0, 0x2899e(%rip)    # 0x32b80
movups %xmm0, 0x289a6(%rip)    # 0x32b8f
leaq 0x28970(%rip), %rsi     # 0x32b60
movdqa 0x1f38(%rip), %xmm0     # 0xc130
movdqa %xmm0, 0x289a0(%rip)    # 0x32ba0
movdqa %xmm0, 0x289a8(%rip)    # 0x32bb0
movdqa %xmm0, 0x289b0(%rip)    # 0x32bc0
movdqu %xmm0, 0x289b7(%rip)    # 0x32bcf
leaq 0x28981(%rip), %rdx     # 0x32ba0
movq %r14, %rdi
movl $0x3f, %ecx
callq 0xa526
cmpb $-0x67, 0x288ed(%rip)   # 0x32b20
jne 0xa44a
movq $-0x1, %rax
cmpq $0x3d, %rax
je 0xa25f
leaq 0x1(%rax), %rcx
cmpb $-0x67, 0x2(%rax,%r14)
movq %rcx, %rax
je 0xa240
cmpq $0x3e, %rcx
jb 0xa44a
movaps 0x1eda(%rip), %xmm0     # 0xc140
movups %xmm0, 0x288e2(%rip)    # 0x32b4f
movaps %xmm0, 0x288cc(%rip)    # 0x32b40
movaps %xmm0, 0x288b5(%rip)    # 0x32b30
movaps %xmm0, 0x2889e(%rip)    # 0x32b20
leaq 0x28897(%rip), %r14     # 0x32b20
movaps 0x1ec0(%rip), %xmm0     # 0xc150
movaps %xmm0, 0x288c9(%rip)    # 0x32b60
movaps %xmm0, 0x288d2(%rip)    # 0x32b70
movaps %xmm0, 0x288db(%rip)    # 0x32b80
movups %xmm0, 0x288e3(%rip)    # 0x32b8f
leaq 0x288ad(%rip), %rsi     # 0x32b60
movdqa 0x1ea5(%rip), %xmm0     # 0xc160
movdqa %xmm0, 0x288dd(%rip)    # 0x32ba0
movdqa %xmm0, 0x288e5(%rip)    # 0x32bb0
movdqa %xmm0, 0x288ed(%rip)    # 0x32bc0
movdqu %xmm0, 0x288f4(%rip)    # 0x32bcf
leaq 0x288be(%rip), %rdx     # 0x32ba0
movq %r14, %rdi
movl $0x3f, %ecx
callq 0xa5c0
cmpb $-0x3a, 0x2882a(%rip)   # 0x32b20
jne 0xa44a
movq $-0x1, %rax
cmpq $0x3d, %rax
je 0xa322
leaq 0x1(%rax), %rcx
cmpb $-0x3a, 0x2(%rax,%r14)
movq %rcx, %rax
je 0xa303
cmpq $0x3e, %rcx
jb 0xa44a
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x28821(%rip)    # 0x32b4f
movdqa %xmm0, 0x2880a(%rip)    # 0x32b40
movdqa %xmm0, 0x287f2(%rip)    # 0x32b30
movdqa %xmm0, 0x287da(%rip)    # 0x32b20
movdqa 0x1e02(%rip), %xmm0     # 0xc150
movdqa %xmm0, 0x2880a(%rip)    # 0x32b60
movdqa %xmm0, 0x28812(%rip)    # 0x32b70
movdqa %xmm0, 0x2881a(%rip)    # 0x32b80
movdqu %xmm0, 0x28821(%rip)    # 0x32b8f
leaq 0x287eb(%rip), %rdx     # 0x32b60
movb 0xec2e(%rip), %r15b     # 0x18faa
movq %r14, %rdi
movl $0x6c, %esi
movl $0x3f, %ecx
callq 0xa88d
xorl %eax, %eax
movb (%rax,%r14), %cl
xorb %r15b, %cl
cmpb $-0x1, %cl
jne 0xa44a
incq %rax
cmpq $0x3f, %rax
jne 0xa390
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x2879a(%rip)    # 0x32b4f
movdqa %xmm0, 0x28783(%rip)    # 0x32b40
movdqa %xmm0, 0x2876b(%rip)    # 0x32b30
movdqa %xmm0, 0x28753(%rip)    # 0x32b20
movdqa 0x1d6b(%rip), %xmm0     # 0xc140
movdqa %xmm0, 0x28783(%rip)    # 0x32b60
movdqa %xmm0, 0x2878b(%rip)    # 0x32b70
movdqa %xmm0, 0x28793(%rip)    # 0x32b80
movdqu %xmm0, 0x2879a(%rip)    # 0x32b8f
leaq 0x28764(%rip), %rsi     # 0x32b60
movb 0xd49f(%rip), %r15b     # 0x178a2
movq %r14, %rdi
movl $0xa2, %edx
movl $0x3f, %ecx
callq 0xa6ad
xorl %eax, %eax
cmpb %r15b, (%rax,%r14)
jne 0xa44a
incq %rax
cmpq $0x3f, %rax
jne 0xa417
cmpb $0x5a, 0x28732(%rip)    # 0x32b5f
jne 0xa44a
cmpb $0x5a, 0x28769(%rip)    # 0x32b9f
jne 0xa44a
xorl %eax, %eax
cmpb $0x5a, 0x2879e(%rip)    # 0x32bdf
sete %al
leal (%rax,%rax,2), %ebx
addl $-0x3, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq