// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rt17.cpp
// Function: bamboo::input_rt17(bamboo::raw_t*, unsigned char)
EXPORT int input_rt17(raw_t *Raw, unsigned char Data)
{
    rt17_t *rt17 = (rt17_t*) Raw->rcv_data;
    unsigned char *MessageBuffer = rt17->MessageBuffer;
    unsigned char *PacketBuffer = rt17->PacketBuffer;
    unsigned int Page, Pages, Reply;
    int Ret = 0;

    /* If no current packet */
    if (rt17->PacketBytes == 0)
    {   
        /* Find something that looks like a packet. */
        if (SyncPacket(rt17, Data))
        {
            /* Found one. */
            rt17->PacketLength = 4 + PacketBuffer[3] + 2; /* 4 (header) + length + 2 (trailer) */
            rt17->PacketBytes = 4; /* We now have four bytes in the packet buffer */
        }
                
        /* Continue reading the rest of the packet from the stream */
        return 0;
    }

    /* Store the next byte of the packet */
    PacketBuffer[rt17->PacketBytes++] = Data;

    /*
    | Keep storing bytes into the current packet
    | until we have what we think are all of them.
    */
    if (rt17->PacketBytes < rt17->PacketLength)
        return 0;

    /*
    | At this point we think have an entire packet.
    | The prospective packet must end with an ETX.
    */
    if (rt17->PacketBuffer[rt17->PacketLength-1] != ETX)
    {
        tracet(2, "RT17: Prospective packet did not end with an ETX character. Some data lost.\n");
        ClearPacketBuffer(rt17);
        return 0;
    }

    /*
    | We do indeed have an entire packet.
    | Check the packet checksum.
    */
    if (!CheckPacketChecksum(PacketBuffer))
    {
        tracet(2, "RT17: Packet checksum failure. Packet discarded.\n");
        ClearPacketBuffer(rt17);
        return 0;
    }

    if (Raw->outtype)
        sprintf(Raw->msgtype, "RT17 0x%02X (%4d)", PacketBuffer[2], rt17->PacketLength);

    /* If this is a SVDATA packet, then process it immediately */
    if (PacketBuffer[2] == RETSVDATA)
    {
        Ret = DecodeRetsvdata(Raw);
        ClearPacketBuffer(rt17);
        return Ret;
    }
        
    /* Accumulate a sequence of RAWDATA packets (pages) */
    if (PacketBuffer[2] == RAWDATA)
    {
        Page  = PacketBuffer[5] >> 4;
        Pages = PacketBuffer[5] & 15;
        Reply = PacketBuffer[6];

        /*
        | If this is the first RAWDATA packet in a sequence of RAWDATA packets,
        | then make sure it's page one and not a packet somewhere in the middle.
        | If not page one, then skip it and continue reading from the stream
        | until we find one that starts at page one. Otherwise make sure it is
        | a part of the same requence of packets as the last one, that it's
        | page number is in sequence.
        */
        if (rt17->MessageBytes == 0)
        {       
            if (Page != 1)
            {
                tracet(2, "RT17: First RAWDATA packet is not page #1. Packet discarded.\n");
                ClearPacketBuffer(rt17);
                return 0;
            }

            rt17->Reply = PacketBuffer[6];
        }
        else if ((Reply != rt17->Reply) || (Page != (rt17->Page + 1)))
        {
            tracet(2, "RT17: RAWDATA packet sequence number mismatch or page out of order. %u RAWDATA packets discarded.\n", Page);
            ClearMessageBuffer(rt17);
            ClearPacketBuffer(rt17);
            return 0;
        }
        
        /* Check for message buffer overflow */
        if ((rt17->MessageBytes + rt17->PacketBytes) > MBUFF_LENGTH)
        {
            tracet(2, "RT17: Buffer would overflow. %u RAWDATA packets discarded.\n", Page);
            ClearMessageBuffer(rt17);
            ClearPacketBuffer(rt17);
            return 0; 
        }

        memcpy(MessageBuffer + rt17->MessageBytes, PacketBuffer, rt17->PacketBytes);
        rt17->MessageBytes += rt17->PacketBytes;
        rt17->MessageLength += rt17->PacketLength;
        ClearPacketBuffer(rt17);

        if (Page == Pages)
        {
            Ret = DecodeRawdata(Raw);
            ClearMessageBuffer(rt17);
            return Ret;
        }

        rt17->Page = Page;

        return 0;
    }

    /* Accumulate a sequence of GENOUT (GSOF) packets (pages) */
    if (PacketBuffer[2] == GENOUT)
    {
        Reply = PacketBuffer[4];
        Page  = PacketBuffer[5];
        Pages = PacketBuffer[6];

        /*
        | If this is the first GENOUT packet in a sequence of GENOUT packets,
        | then make sure it's page zero and not a packet somewhere in the middle.
        | If not page zero, then skip it and continue reading from the stream
        | until we find one that starts at page zero. Otherwise make sure it is
        | a part of the same requence of packets as the last one, that it's
        | page number is in sequence.
        */
        if (rt17->MessageBytes == 0)
        {       
            if (Page != 0)
            {
                tracet(3, "RT17: First GENOUT packet is not page #0. Packet discarded.\n");
                ClearPacketBuffer(rt17);
                return 0;
            }

            rt17->Reply = PacketBuffer[4];
        }
        else if ((Reply != rt17->Reply) || (Page != (rt17->Page + 1)))
        {
            tracet(2, "RT17: GENOUT packet sequence number mismatch or page out of order. %u GENOUT packets discarded.\n", Page);
            ClearMessageBuffer(rt17);
            ClearPacketBuffer(rt17);
            return 0;
        }
        
        /* Check for message buffer overflow. */
        if ((rt17->MessageBytes + rt17->PacketBytes) > MBUFF_LENGTH)
        {
            tracet(2, "RT17: Buffer would overflow. %u GENOUT packets discarded.\n", Page);
            ClearMessageBuffer(rt17);
            ClearPacketBuffer(rt17);
            return 0; 
        }

        memcpy(MessageBuffer + rt17->MessageBytes, PacketBuffer, rt17->PacketBytes);
        rt17->MessageBytes += rt17->PacketBytes;
        rt17->MessageLength += rt17->PacketLength;
        ClearPacketBuffer(rt17);

        if (Page == Pages)
        {
            Ret = DecodeGSOF(Raw);
            ClearMessageBuffer(rt17);
            return Ret;
        }

        rt17->Page = Page;

        return 0;
    }

    /*
    | If we fall through to here, then the packet is not one that we support
    | (and hence we can't really even get here). Dump the packet on the floor
    | and continue reading from the stream.
    */
    tracet(2, "RT17: Packet is not GENOUT, RAWDATA or RETSVDATA. Packet discarded.\n"); 
    ClearPacketBuffer(rt17);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq 0x82ba0(%rdi), %rbx
movq 0x8(%rbx), %r12
movl 0x24(%rbx), %eax
testq %rax, %rax
je 0x311ab
movq (%rbx), %r13
leal 0x1(%rax), %ecx
movl %ecx, 0x24(%rbx)
movb %sil, (%r12,%rax)
movl 0x28(%rbx), %ecx
xorl %r15d, %r15d
cmpl %ecx, 0x24(%rbx)
jb 0x312ab
movq 0x8(%rbx), %rax
leal -0x1(%rcx), %edx
cmpb $0x3, (%rax,%rdx)
jne 0x31213
movq %rdi, %r14
movzbl 0x3(%r12), %eax
leaq 0x3(%rax), %rdx
xorl %esi, %esi
xorl %edi, %edi
cmpl %esi, %edx
je 0x3121c
addb 0x1(%r12,%rsi), %dil
incq %rsi
jmp 0x3119d
movb 0x1(%r12), %cl
movb 0x2(%r12), %al
movb %cl, (%r12)
movb %al, 0x1(%r12)
movzbl 0x3(%r12), %eax
movb %al, 0x2(%r12)
movb %sil, 0x3(%r12)
xorl %r15d, %r15d
testb %sil, %sil
je 0x312ab
cmpb $0x2, %cl
jne 0x312ab
addl $-0x40, %eax
cmpl $0x17, %eax
ja 0x312ab
movl $0xa00001, %ecx         # imm = 0xA00001
btl %eax, %ecx
jae 0x312ab
movzbl %sil, %eax
addl $0x6, %eax
movl %eax, 0x28(%rbx)
movl $0x4, 0x24(%rbx)
jmp 0x312ab
leaq 0x321bc(%rip), %rsi     # 0x633d6
jmp 0x31296
cmpb 0x4(%r12,%rax), %dil
jne 0x3128f
cmpl $0x0, 0x81a8c(%r14)
je 0x31248
leaq 0x70e70(%r14), %rdi
movzbl 0x2(%r12), %edx
leaq 0x32214(%rip), %rsi     # 0x63455
xorl %eax, %eax
callq 0x8110
movzbl 0x2(%r12), %eax
cmpl $0x40, %eax
je 0x312fe
cmpl $0x57, %eax
je 0x312c0
cmpl $0x55, %eax
jne 0x3133a
movq 0x82ba0(%r14), %rax
movq 0x8(%rax), %rcx
movzbl 0x4(%rcx), %r12d
cmpq $0x16, %r12
ja 0x31346
leaq 0x545aa(%rip), %rcx     # 0x85830
movq (%rcx,%r12,8), %rdx
jmp 0x31348
leaq 0x3218d(%rip), %rsi     # 0x63423
xorl %r15d, %r15d
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x4acf2
movq %rbx, %rdi
callq 0x3255f
movl %r15d, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzbl 0x5(%r12), %r15d
movl %r15d, %r8d
shrl $0x4, %r8d
movzbl 0x6(%r12), %ecx
movl 0x1c(%rbx), %eax
testq %rax, %rax
je 0x313e9
cmpl %ecx, 0x30(%rbx)
jne 0x312f2
movl 0x2c(%rbx), %ecx
incl %ecx
cmpl %ecx, %r8d
je 0x313f2
leaq 0x321ac(%rip), %rsi     # 0x634a5
jmp 0x3151f
movzbl 0x4(%r12), %ecx
movzbl 0x5(%r12), %r8d
movb 0x6(%r12), %r15b
movl 0x1c(%rbx), %eax
testq %rax, %rax
je 0x3140c
cmpl %ecx, 0x30(%rbx)
jne 0x3132e
movl 0x2c(%rbx), %ecx
incl %ecx
cmpl %r8d, %ecx
je 0x3150a
leaq 0x3224c(%rip), %rsi     # 0x63581
jmp 0x3151f
leaq 0x322dc(%rip), %rsi     # 0x6361d
jmp 0x31296
xorl %edx, %edx
testq %rdx, %rdx
leaq 0x32310(%rip), %rcx     # 0x63662
cmovneq %rdx, %rcx
movl 0x28(%rax), %r8d
leaq 0x32a59(%rip), %rsi     # 0x63dba
xorl %r15d, %r15d
pushq $0x3
popq %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0x4acf2
cmpq $0x15, %r12
je 0x314fe
cmpl $0x3, %r12d
je 0x314b3
cmpl $0x9, %r12d
je 0x31487
cmpl $0xb, %r12d
je 0x31499
cmpl $0xe, %r12d
je 0x31490
cmpl $0x1, %r12d
jne 0x314a2
movq 0x82ba0(%r14), %r13
movq 0x8(%r13), %r12
movl 0x28(%r13), %edx
leaq 0x32b38(%rip), %rsi     # 0x63efb
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x4acf2
movl 0x28(%r13), %edx
cmpl $0xb5, %edx
ja 0x31876
leaq 0x32b3e(%rip), %rsi     # 0x63f22
jmp 0x314ed
cmpl $0x1, %r8d
jne 0x31421
movl %ecx, 0x30(%rbx)
movl 0x24(%rbx), %edx
leal (%rdx,%rax), %ecx
cmpl $0x2001, %ecx           # imm = 0x2001
jb 0x3142d
leaq 0x32101(%rip), %rsi     # 0x63508
jmp 0x3151f
testl %r8d, %r8d
je 0x31507
leaq 0x32128(%rip), %rsi     # 0x63544
jmp 0x314a9
leaq 0x3203f(%rip), %rsi     # 0x63467
jmp 0x31296
andl $0xf, %r15d
addq %rax, %r13
movq %r13, %rdi
movq %r12, %rsi
movl %r8d, %r12d
callq 0x84f0
movl 0x24(%rbx), %eax
movl 0x28(%rbx), %ecx
addl %eax, 0x1c(%rbx)
addl %ecx, 0x20(%rbx)
movq %rbx, %rdi
callq 0x3255f
cmpl %r15d, %r12d
jne 0x315d1
movq 0x82ba0(%r14), %r15
movq (%r15), %rax
movzbl 0x4(%rax), %edx
cmpq $0x7, %rdx
ja 0x31ad8
leaq 0x54372(%rip), %rax     # 0x857f0
movq (%rax,%rdx,8), %rax
jmp 0x31ada
leaq 0x32c97(%rip), %rsi     # 0x64125
jmp 0x314a9
leaq 0x32cee(%rip), %rsi     # 0x64185
jmp 0x314a9
leaq 0x32cb5(%rip), %rsi     # 0x64155
jmp 0x314a9
leaq 0x326d0(%rip), %rsi     # 0x63b79
xorl %r15d, %r15d
pushq $0x3
jmp 0x3129b
movq %r14, %r12
movq 0x82ba0(%r14), %r14
movq 0x8(%r14), %r15
movl 0x28(%r14), %edx
leaq 0x32bde(%rip), %rsi     # 0x640aa
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x4acf2
movl 0x28(%r14), %edx
cmpl $0x80, %edx
ja 0x319fb
leaq 0x32be4(%rip), %rsi     # 0x640d1
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x4acf2
pushq $-0x1
jmp 0x32496
leaq 0x32cad(%rip), %rsi     # 0x641b2
jmp 0x314ac
movl %ecx, 0x30(%rbx)
movl 0x24(%rbx), %edx
leal (%rdx,%rax), %ecx
cmpl $0x2001, %ecx           # imm = 0x2001
jb 0x3153c
leaq 0x320c3(%rip), %rsi     # 0x635e2
xorl %r15d, %r15d
pushq $0x2
popq %rdi
movl %r8d, %edx
xorl %eax, %eax
callq 0x4acf2
movq %rbx, %rdi
callq 0x3257f
jmp 0x312a3
addq %rax, %r13
movq %r13, %rdi
movq %r12, %rsi
movl %r8d, %r12d
callq 0x84f0
movl 0x24(%rbx), %eax
movl 0x28(%rbx), %ecx
addl %eax, 0x1c(%rbx)
addl %ecx, 0x20(%rbx)
movq %rbx, %rdi
callq 0x3255f
cmpb %r15b, %r12b
jne 0x315d1
movq %rbx, -0x60(%rbp)
movq 0x82ba0(%r14), %rax
movq (%rax), %r15
movq %rax, -0x40(%rbp)
movl 0x20(%rax), %ebx
xorl %r13d, %r13d
movq %r15, %rcx
movq %r14, -0x88(%rbp)
testl %ebx, %ebx
je 0x315dd
movzbl 0x3(%rcx), %r14d
leaq 0x6(%r14), %rdx
movq %rdx, -0x38(%rbp)
leal -0x3(%r14), %r12d
leaq 0x7(%rcx), %rsi
movq %r15, %rdi
movq %r12, %rdx
movq %rcx, -0x30(%rbp)
callq 0x8a40
movq -0x30(%rbp), %rcx
addq %r14, %rcx
addq $0x6, %rcx
addq %r12, %r15
addl %r14d, %r13d
addl $-0x3, %r13d
movq -0x88(%rbp), %r14
subl -0x38(%rbp), %ebx
jmp 0x31588
movl %r12d, 0x2c(%rbx)
xorl %r15d, %r15d
jmp 0x312ab
movq -0x40(%rbp), %rax
movl %r13d, 0x20(%rax)
movl %r13d, 0x1c(%rax)
movq (%rax), %r12
leaq 0x70db8(%r14), %rax
movq %rax, -0x58(%rbp)
leaq 0x70e20(%r14), %rax
movq %rax, -0x48(%rbp)
xorl %r15d, %r15d
xorl %ecx, %ecx
movq -0x60(%rbp), %rbx
testl %r13d, %r13d
je 0x32038
movq %r13, -0x30(%rbp)
movzbl (%r12), %r13d
cmpq $0x29, %r13
ja 0x3162e
leaq 0x54076(%rip), %rax     # 0x856a0
movq (%rax,%r13,8), %rcx
movzbl 0x1(%r12), %r8d
testq %rcx, %rcx
leaq 0x32024(%rip), %rax     # 0x63662
cmoveq %rax, %rcx
pushq $0x3
popq %rdi
leaq 0x3201e(%rip), %rsi     # 0x6366a
movl %r13d, %edx
movq %rcx, -0x38(%rbp)
movl %r8d, -0x40(%rbp)
xorl %eax, %eax
callq 0x4acf2
cmpq $0x29, %r13
je 0x31743
cmpl $0x3, %r13d
je 0x3171e
cmpl $0xf, %r13d
je 0x316ab
cmpl $0x10, %r13d
je 0x316ea
cmpl $0x1a, %r13d
je 0x316cc
cmpl $0x1, %r13d
jne 0x31708
movzbl 0x1(%r12), %edx
cmpl $0x5, %edx
ja 0x31767
xorl %r15d, %r15d
pushq $0x2
popq %rdi
leaq 0x3221b(%rip), %rsi     # 0x638c1
jmp 0x3175b
movzbl 0x1(%r12), %edx
cmpl $0xe, %edx
ja 0x317a6
xorl %r15d, %r15d
pushq $0x2
popq %rdi
leaq 0x3230a(%rip), %rsi     # 0x639d1
jmp 0x3175b
movzbl 0x1(%r12), %edx
cmpl $0x5, %edx
ja 0x31767
xorl %r15d, %r15d
pushq $0x2
popq %rdi
leaq 0x3238d(%rip), %rsi     # 0x63a75
jmp 0x3175b
movzbl 0x1(%r12), %edx
xorl %r15d, %r15d
cmpl $0x8, %edx
ja 0x317cc
pushq $0x2
popq %rdi
leaq 0x32320(%rip), %rsi     # 0x63a26
jmp 0x3175b
pushq $0x3
popq %rdi
leaq 0x31fa7(%rip), %rsi     # 0x636b9
xorl %eax, %eax
callq 0x4acf2
jmp 0x3185b
movzbl 0x1(%r12), %edx
cmpl $0x17, %edx
ja 0x31811
pushq $0x2
popq %rdi
leaq 0x32251(%rip), %rsi     # 0x63988
xorl %eax, %eax
callq 0x4acf2
jmp 0x31857
movzbl 0x1(%r12), %edx
cmpl $0x5, %edx
ja 0x31767
xorl %r15d, %r15d
pushq $0x2
popq %rdi
leaq 0x3236e(%rip), %rsi     # 0x63ac9
xorl %eax, %eax
callq 0x4acf2
jmp 0x3185b
movzbl 0x7(%r12), %eax
movzbl 0x6(%r12), %ecx
shll $0x8, %ecx
movswl %cx, %r15d
orl %eax, %r15d
leaq 0x2(%r12), %rdi
callq 0x32693
cvtsi2sd %eax, %xmm0
mulsd 0x305e5(%rip), %xmm0    # 0x61d78
movq %r14, %rdi
movl %r15d, %esi
callq 0x325ee
xorl %r15d, %r15d
jmp 0x3185b
leaq 0x2(%r12), %rdi
callq 0x3269d
xorl %r15d, %r15d
movq -0x58(%rbp), %rdi
leaq 0x32265(%rip), %rsi     # 0x63a23
movl %eax, %edx
xorl %eax, %eax
callq 0x8110
jmp 0x3185b
testb $0x1, 0xa(%r12)
je 0x3185b
movzbl 0x7(%r12), %eax
movzbl 0x6(%r12), %ecx
shll $0x8, %ecx
movswl %cx, %r13d
orl %eax, %r13d
leaq 0x2(%r12), %rdi
callq 0x32693
cvtsi2sd %eax, %xmm0
mulsd 0x30574(%rip), %xmm0    # 0x61d78
movq %r14, %rdi
movl %r13d, %esi
callq 0x325ee
jmp 0x3185b
movq 0x2(%r12), %rax
bswapq %rax
movq %rax, 0x70e08(%r14)
movq 0xa(%r12), %rax
bswapq %rax
movq %rax, 0x70e10(%r14)
movq 0x12(%r12), %rax
bswapq %rax
movq %rax, 0x70e18(%r14)
andl $0x0, 0x70e00(%r14)
movq -0x48(%rbp), %rax
xorpd %xmm0, %xmm0
movupd %xmm0, 0x10(%rax)
movupd %xmm0, (%rax)
pushq $0x5
popq %r15
movq -0x30(%rbp), %r13
movq -0x38(%rbp), %rcx
movl -0x40(%rbp), %eax
addb $0x2, %al
movzbl %al, %eax
addq %rax, %r12
subl %eax, %r13d
jmp 0x3160b
movzbl 0x5(%r12), %r15d
pushq $0x1
popq %rdi
movl %r15d, %esi
callq 0x452fd
testl %eax, %eax
je 0x31f7b
movl %eax, -0x40(%rbp)
movzwl 0x6(%r12), %eax
movzwl 0x8(%r12), %r15d
rolw $0x8, %ax
rolw $0x8, %r15w
movzwl %ax, %eax
movl %eax, -0x30(%rbp)
movzwl %r15w, %eax
movq %rax, -0x58(%rbp)
movzbl 0xb(%r12), %eax
movl %eax, -0x38(%rbp)
leaq 0xc(%r12), %rdi
callq 0x32693
movl %eax, -0x60(%rbp)
leaq 0x10(%r12), %rdi
callq 0x32693
movl %eax, -0x68(%rbp)
leaq 0x14(%r12), %rdi
callq 0x3269d
movl %eax, -0x48(%rbp)
movq 0x18(%r12), %rax
movq %rax, -0x78(%rbp)
movq 0x20(%r12), %rax
movq %rax, -0x70(%rbp)
movq 0x28(%r12), %rax
movq %rax, -0x80(%rbp)
movq 0x30(%r12), %rax
movq %rax, -0x128(%rbp)
movq 0x38(%r12), %rax
movq %rax, -0x120(%rbp)
movq 0x40(%r12), %rax
movq %rax, -0xb0(%rbp)
movq 0x48(%r12), %rax
movq %rax, -0xb8(%rbp)
movq 0x50(%r12), %rax
movq %rax, -0xc0(%rbp)
movq 0x58(%r12), %rax
movq %rax, -0x110(%rbp)
movq 0x60(%r12), %rax
movq %rax, -0xd0(%rbp)
movq 0x68(%r12), %rax
movq %rax, -0x108(%rbp)
movq 0x70(%r12), %rax
movq %rax, -0xc8(%rbp)
movq 0x78(%r12), %rax
movq %rax, -0xd8(%rbp)
movq 0x80(%r12), %rax
movq %rax, -0xe0(%rbp)
movq 0x88(%r12), %rax
movq %rax, -0xf8(%rbp)
movq 0x90(%r12), %rax
movq %rax, -0x118(%rbp)
movq 0x98(%r12), %rax
movq %rax, -0xe8(%rbp)
movq 0xa0(%r12), %rax
movq %rax, -0xf0(%rbp)
movq 0xa8(%r12), %rax
movq %rax, -0x100(%rbp)
addq $0xb0, %r12
movq %r12, %rdi
callq 0x3269d
movl %eax, %r12d
btl $0xa, %eax
jb 0x31f8d
movsd 0x2eea2(%rip), %xmm0    # 0x60898
jmp 0x3207c
xorps %xmm0, %xmm0
movq %r12, %rdi
callq 0x326a7
movq 0x6(%r15), %rcx
bswapq %rcx
movq %rcx, 0x1eb0(%r12)
movq 0xe(%r15), %rcx
bswapq %rcx
movq %rcx, 0x1eb8(%r12)
movq 0x16(%r15), %rcx
bswapq %rcx
movq %rcx, 0x1ec0(%r12)
movq 0x1e(%r15), %rcx
bswapq %rcx
movq %rcx, 0x1ec8(%r12)
movq 0x26(%r15), %rcx
bswapq %rcx
movq %rcx, 0x1ed0(%r12)
movq 0x2e(%r15), %rcx
bswapq %rcx
movq %rcx, 0x1ed8(%r12)
movq 0x36(%r15), %rcx
bswapq %rcx
movq %rcx, 0x1ee0(%r12)
movq 0x3e(%r15), %rcx
bswapq %rcx
movq %rcx, 0x1ee8(%r12)
movq 0x46(%r15), %rcx
bswapq %rcx
movq %rcx, 0x1dd0(%r12)
movq 0x4e(%r15), %rcx
bswapq %rcx
movq %rcx, 0x1dd8(%r12)
movq 0x56(%r15), %rcx
bswapq %rcx
movq %rcx, 0x1de0(%r12)
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x1de8(%r12)
movq 0x5e(%r15), %rax
bswapq %rax
movq %rax, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x1fd0(%r12)
pushq $0x9
jmp 0x32496
xorl %eax, %eax
testq %rax, %rax
leaq 0x31b7e(%rip), %rcx     # 0x63662
cmovneq %rax, %rcx
movl 0x20(%r15), %r8d
leaq 0x3203c(%rip), %rsi     # 0x63b2f
pushq $0x3
popq %rdi
movq %rdx, -0x48(%rbp)
xorl %eax, %eax
callq 0x4acf2
movq (%r15), %rcx
movq %r15, -0x60(%rbp)
movl 0x20(%r15), %edx
movzbl 0x7(%rcx), %eax
movl %eax, -0x58(%rbp)
movq %rcx, %r12
xorl %esi, %esi
movq %r14, -0x88(%rbp)
testl %edx, %edx
je 0x31b96
movq %rsi, -0x38(%rbp)
movl %edx, -0x30(%rbp)
movl -0x58(%rbp), %eax
cmpb 0x7(%r12), %al
je 0x31b4b
movq %rcx, %r14
pushq $0x2
popq %rdi
leaq 0x320e2(%rip), %rsi     # 0x63c23
xorl %eax, %eax
callq 0x4acf2
movq %r14, %rcx
movzbl 0x3(%r12), %r15d
leaq 0x6(%r15), %rax
movq %rax, -0x40(%rbp)
leal -0x4(%r15), %r13d
leaq 0x8(%r12), %rsi
movq %rcx, %r14
movq %rcx, %rdi
movq %r13, %rdx
callq 0x8a40
movq %r14, %rcx
addq %r15, %r12
addq $0x6, %r12
addq %r13, %rcx
movq -0x38(%rbp), %rsi
addl %r15d, %esi
addl $-0x4, %esi
movl -0x30(%rbp), %edx
subl -0x40(%rbp), %edx
movq -0x88(%rbp), %r14
jmp 0x31b1f
movq -0x60(%rbp), %rax
movl %esi, 0x20(%rax)
movl %esi, 0x1c(%rax)
movq -0x48(%rbp), %rax
cmpq $0x7, %rax
je 0x31f33
testl %eax, %eax
jne 0x31f62
movq 0x82ba0(%r14), %rax
movq (%rax), %r12
movq (%r12), %rax
bswapq %rax
movq %rax, %xmm0
mulsd 0x301a4(%rip), %xmm0    # 0x61d78
movsd %xmm0, -0x30(%rbp)
movq %r14, %rdi
callq 0x326a7
movl %eax, %edi
movsd -0x30(%rbp), %xmm0
callq 0x4708a
movq %rax, -0x60(%rbp)
movsd %xmm0, -0x68(%rbp)
movzbl 0x10(%r12), %eax
addq $0x11, %r12
cmpb $0x40, %al
pushq $0x40
popq %rcx
cmovbl %eax, %ecx
movzbl %cl, %edx
movl -0x58(%rbp), %eax
andl $0x2, %eax
shrl %eax
leaq (%rax,%rax,2), %rax
movq %rax, -0x80(%rbp)
xorl %ecx, %ecx
subl $0x1, %edx
jb 0x31fac
movl %edx, -0x40(%rbp)
movq 0x1d28(%r14), %r13
movl %ecx, -0x38(%rbp)
movslq %ecx, %rax
imulq $0x60, %rax, %r15
leaq (%r15,%r13), %rsi
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%r13,%r15)
movups %xmm0, 0x40(%r13,%r15)
movups %xmm0, 0x30(%r13,%r15)
movups %xmm0, 0x20(%r13,%r15)
movups %xmm0, 0x10(%r13,%r15)
movq -0x60(%rbp), %rax
movq %rax, (%r13,%r15)
movsd -0x68(%rbp), %xmm0
movsd %xmm0, 0x8(%r13,%r15)
movzbl (%r12), %eax
movl %eax, -0x30(%rbp)
movzbl 0x1(%r12), %r8d
movzbl 0x2(%r12), %edi
testb $0x1, -0x58(%rbp)
jne 0x31cb5
testb $0x1, 0x3(%r12)
je 0x32035
xorpd %xmm2, %xmm2
testb $0x40, %r8b
jne 0x31d94
addq $0x8, %r12
pxor %xmm3, %xmm3
jmp 0x31df2
xorpd %xmm2, %xmm2
testb $0x40, %r8b
jne 0x31cc9
addq $0x6, %r12
xorpd %xmm3, %xmm3
jmp 0x31d28
movl %edi, -0x50(%rbp)
movb 0x6(%r12), %al
movb %al, 0x12(%rsi)
movq 0x7(%r12), %rax
bswapq %rax
movq %rax, 0x38(%rsi)
movl %r8d, -0x78(%rbp)
testb $0x10, %r8b
je 0x31cfb
movq 0xf(%r12), %rcx
bswapq %rcx
btcq $0x3f, %rcx
movq %rcx, 0x20(%rsi)
movq %rax, -0x70(%rbp)
leaq 0x17(%r12), %rdi
movq %rsi, -0x48(%rbp)
callq 0x3269d
movsd -0x70(%rbp), %xmm3
movq -0x48(%rbp), %rsi
movl %eax, 0x50(%rsi)
addq $0x1b, %r12
movl -0x50(%rbp), %edi
movl -0x78(%rbp), %r8d
xorpd %xmm2, %xmm2
testb $0x1, %r8b
je 0x31d8b
movb (%r12), %al
movb %al, 0x13(%rsi)
testb $0x20, %r8b
je 0x31d87
movq 0x1(%r12), %rax
bswapq %rax
btcq $0x3f, %rax
movq %rax, 0x28(%rsi)
movl %edi, -0x50(%rbp)
leaq 0x9(%r12), %rdi
movq %rsi, -0x48(%rbp)
movl %r8d, -0x78(%rbp)
movsd %xmm3, -0x70(%rbp)
callq 0x3269d
movsd -0x70(%rbp), %xmm3
movl -0x78(%rbp), %r8d
movl -0x50(%rbp), %edi
movq -0x48(%rbp), %rsi
movd %eax, %xmm0
cvtss2sd %xmm0, %xmm2
addsd %xmm3, %xmm2
movsd %xmm2, 0x40(%rsi)
addq $0xd, %r12
addq -0x80(%rbp), %r12
jmp 0x31e64
movq 0x8(%r12), %rax
bswapq %rax
movq %rax, %xmm0
mulsd 0x2eaef(%rip), %xmm0    # 0x60898
cvttsd2si %xmm0, %eax
movb %al, 0x12(%rsi)
movq 0x10(%r12), %rax
bswapq %rax
movq %rax, 0x38(%rsi)
testb $0x10, %r8b
je 0x31dd3
movq 0x18(%r12), %rcx
bswapq %rcx
btcq $0x3f, %rcx
movq %rcx, 0x20(%rsi)
movq %rax, %xmm3
movq 0x20(%r12), %rax
bswapq %rax
movq %rax, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x50(%rsi)
addq $0x30, %r12
testb $0x1, %r8b
je 0x31e44
movq (%r12), %rax
bswapq %rax
movq %rax, %xmm0
mulsd 0x2ea8c(%rip), %xmm0    # 0x60898
cvttsd2si %xmm0, %eax
movb %al, 0x13(%rsi)
testb $0x20, %r8b
je 0x31e40
movq 0x8(%r12), %rax
bswapq %rax
btcq $0x3f, %rax
movq %rax, 0x28(%rsi)
movq 0x10(%r12), %rax
bswapq %rax
movq %rax, %xmm2
addsd %xmm3, %xmm2
movsd %xmm2, 0x40(%rsi)
addq $0x18, %r12
testb $0x2, -0x58(%rbp)
je 0x31e64
movq 0x4(%r12), %rax
bswapq %rax
movq %rax, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x54(%rsi)
addq $0xc, %r12
movl %edi, %ecx
andb $0x1, %cl
incb %cl
xorl %eax, %eax
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm3
movzbl %cl, %ecx
movl $0x0, %edx
cmovnel %ecx, %edx
cmovpl %ecx, %edx
movb %dl, 0x18(%rsi)
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm2
jne 0x31e91
jnp 0x31ea8
movb $0x14, %al
testb $0x4, %dil
jne 0x31ea8
xorl %eax, %eax
testb $0x2, %dil
setne %al
leal (%rax,%rax,4), %eax
addl $0xe, %eax
movb %al, 0x19(%rsi)
testb $0x2, %r8b
je 0x31eb5
movb $0x1, 0x15(%rsi)
movq %r12, -0x48(%rbp)
movb $0x4, %al
testb $0x4, %r8b
je 0x31ec7
movb $0x1, 0x16(%rsi)
movb $0x5, %al
movq %r14, %r12
testb $0x4, %dil
je 0x31edb
ucomisd %xmm0, %xmm2
jne 0x31ed8
jnp 0x31edb
movb %al, 0x16(%rsi)
leaq (%r15,%r13), %r14
addq $0x10, %r14
pushq $0x1
popq %rdi
movl -0x30(%rbp), %r15d
movl %r15d, %esi
callq 0x452fd
movb %al, (%r14)
testb %al, %al
je 0x31f0d
movl -0x38(%rbp), %ecx
incl %ecx
movq %r12, %r14
movq -0x48(%rbp), %r12
movl -0x40(%rbp), %edx
jmp 0x31c1d
pushq $0x2
popq %rdi
leaq 0x31d5d(%rip), %rsi     # 0x63c74
movl %r15d, %edx
xorl %eax, %eax
callq 0x4acf2
movq %r12, %r14
movq -0x48(%rbp), %r12
movl -0x38(%rbp), %ecx
movl -0x40(%rbp), %edx
jmp 0x31c1d
movq 0x82ba0(%r14), %rax
movq (%rax), %rdi
movzbl (%rdi), %edx
cmpl $0x6, %edx
ja 0x32003
leaq 0x31e1a(%rip), %rsi     # 0x63d6a
xorl %r15d, %r15d
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x4acf2
jmp 0x32038
leaq 0x31c10(%rip), %rsi     # 0x63b79
xorl %r15d, %r15d
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x4acf2
jmp 0x32038
leaq 0x31fef(%rip), %rsi     # 0x63f71
pushq $0x2
popq %rdi
movl %r15d, %edx
jmp 0x314f0
movl %r15d, %eax
andl $0xfff8, %eax           # imm = 0xFFF8
cmpw $0xf0, %ax
jne 0x32045
movsd 0x2ea89(%rip), %xmm0    # 0x60a30
jmp 0x3207c
movq -0x60(%rbp), %rax
movq %rax, (%r14)
movsd -0x68(%rbp), %xmm0
movsd %xmm0, 0x8(%r14)
movl %ecx, 0x1d20(%r14)
movl %ecx, %r12d
testl %ecx, %ecx
jle 0x31ff7
leaq 0x31cc8(%rip), %rsi     # 0x63c9b
pushq $0x2
popq %r15
movl %r15d, %edi
xorl %eax, %eax
callq 0x4acf2
movq 0x1d28(%r14), %rsi
movl 0x1d20(%r14), %edx
movl %r15d, %edi
callq 0x4acf8
xorl %r15d, %r15d
testl %r12d, %r12d
setg %r15b
jmp 0x32038
movzbl 0x2(%rdi), %eax
movzbl 0x1(%rdi), %ecx
shll $0x8, %ecx
movswl %cx, %r15d
orl %eax, %r15d
addq $0x3, %rdi
callq 0x32693
cvtsi2sd %eax, %xmm0
mulsd 0x2fd4e(%rip), %xmm0    # 0x61d78
movq %r14, %rdi
movl %r15d, %esi
callq 0x325ee
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x3257f
jmp 0x312ab
cmpw $0xf8, %ax
sete %al
cmpw $0x1f0, %r15w           # imm = 0x1F0
sete %cl
orb %al, %cl
je 0x32063
movsd 0x2e937(%rip), %xmm0    # 0x60998
jmp 0x3207c
leal -0x1f1(%r15), %eax
cmpw $0x7, %ax
jae 0x3249d
movsd 0x31284(%rip), %xmm0    # 0x63300
movsd %xmm0, -0x50(%rbp)
movl -0x48(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x48(%rbp)
cvtsi2sdl -0x68(%rbp), %xmm0
movl -0x30(%rbp), %r15d
movl %r15d, %edi
callq 0x4708a
movq %rax, -0xa8(%rbp)
movsd %xmm0, -0x68(%rbp)
movl %r15d, %edi
movsd -0x48(%rbp), %xmm0
callq 0x4708a
movq %rax, -0x98(%rbp)
movsd %xmm0, -0x90(%rbp)
cvtsi2sdl -0x60(%rbp), %xmm0
movl %r15d, %edi
callq 0x4708a
movq %rax, -0xa0(%rbp)
movsd %xmm0, -0x60(%rbp)
leaq 0x31ebf(%rip), %rsi     # 0x63fa6
pushq $0x3
popq %rdi
movl -0x40(%rbp), %edx
movq -0x58(%rbp), %rcx
movl -0x38(%rbp), %r8d
movl %r15d, %r9d
xorl %eax, %eax
callq 0x4acf2
movl 0x34(%r13), %eax
testl %eax, %eax
je 0x3213d
cmpl %r15d, %eax
je 0x3213d
leaq 0x31ed3(%rip), %rsi     # 0x63fe6
pushq $0x2
popq %r15
movl %r15d, %edi
xorl %eax, %eax
callq 0x4acf2
movl 0x34(%r13), %edx
leaq 0x31f0b(%rip), %rsi     # 0x64037
movl %r15d, %edi
movl -0x30(%rbp), %r15d
movl %r15d, %ecx
xorl %eax, %eax
callq 0x4acf2
movl 0x18(%r13), %eax
testb $0x1, %al
jne 0x32197
movl 0x34(%r13), %edx
testl %edx, %edx
je 0x32157
andl $0x4, %eax
jne 0x32157
cmpl %r15d, %edx
jge 0x32197
testl %edx, %edx
je 0x32171
leaq 0x31f15(%rip), %rsi     # 0x64077
pushq $0x2
popq %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x4acf2
jmp 0x32185
leaq 0x31baa(%rip), %rsi     # 0x63d22
pushq $0x2
popq %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x4acf2
movl 0x18(%r13), %eax
andl $-0x7, %eax
orl $0x2, %eax
movl %eax, 0x18(%r13)
movl %r15d, 0x34(%r13)
leaq 0x82a90(%r14), %rdi
leaq 0x30522(%rip), %rsi     # 0x626c7
callq 0x8170
movq 0x1d80(%r14), %rcx
movl -0x40(%rbp), %esi
movslq %esi, %rdx
testq %rax, %rax
jne 0x321d6
imulq $0x120, %rdx, %rax      # imm = 0x120
xorl %r15d, %r15d
movl -0x38(%rbp), %edi
cmpl %edi, -0x11c(%rcx,%rax)
je 0x312a3
movq -0xb0(%rbp), %rax
bswapq %rax
movq %rax, %xmm2
movq -0xb8(%rbp), %rax
bswapq %rax
movq %rax, %xmm4
movq -0xc0(%rbp), %rax
bswapq %rax
movq %rax, %xmm0
movq -0xd0(%rbp), %rax
bswapq %rax
movq -0xc8(%rbp), %rdi
bswapq %rdi
movq %rax, %xmm1
movq %rdi, %xmm3
movq -0xd8(%rbp), %rax
bswapq %rax
movq %rax, %xmm6
movq -0xe0(%rbp), %rax
bswapq %rax
movq %rax, %xmm5
movq -0xf8(%rbp), %rax
bswapq %rax
movq -0xe8(%rbp), %rdi
bswapq %rdi
movq %rax, %xmm10
movq %rdi, %xmm9
movq -0xf0(%rbp), %rax
bswapq %rax
movq %rax, %xmm7
movq -0x100(%rbp), %rax
bswapq %rax
movq %rax, %xmm8
imulq $0x120, %rdx, %rax      # imm = 0x120
movl %esi, -0x120(%rcx,%rax)
movl -0x38(%rbp), %edx
movl %edx, -0x11c(%rcx,%rax)
movq -0x58(%rbp), %rdx
movl %edx, -0x118(%rcx,%rax)
movl %r12d, %edx
shrl $0xb, %edx
andl $0xf, %edx
movl %edx, -0x114(%rcx,%rax)
movl %r12d, %edx
shrl $0x4, %edx
andl $0x7f, %edx
movl %edx, -0x110(%rcx,%rax)
movl -0x30(%rbp), %edx
movl %edx, -0x10c(%rcx,%rax)
movl %r12d, %edx
shrl %edx
andl $0x3, %edx
movl %edx, -0x108(%rcx,%rax)
andl $0x1, %r12d
movl %r12d, -0x104(%rcx,%rax)
movq -0x98(%rbp), %rdx
movq %rdx, -0x100(%rcx,%rax)
movsd -0x90(%rbp), %xmm11
movsd %xmm11, -0xf8(%rcx,%rax)
movq -0xa8(%rbp), %rdx
movq %rdx, -0xf0(%rcx,%rax)
movsd 0x2fa8b(%rip), %xmm11   # 0x61da8
mulsd %xmm11, %xmm2
mulsd %xmm11, %xmm10
mulsd %xmm11, %xmm8
mulsd %xmm11, %xmm4
mulsd %xmm11, %xmm9
mulsd %xmm11, %xmm6
mulsd %xmm11, %xmm7
mulsd %xmm11, %xmm3
mulsd %xmm11, %xmm5
mulsd %xmm11, %xmm0
mulsd %xmm11, %xmm1
movsd -0x68(%rbp), %xmm11
movsd %xmm11, -0xe8(%rcx,%rax)
movq -0xa0(%rbp), %rdx
movq %rdx, -0xe0(%rcx,%rax)
movq -0x108(%rbp), %rdx
bswapq %rdx
movsd -0x60(%rbp), %xmm11
movsd %xmm11, -0xd8(%rcx,%rax)
movq %rdx, %xmm11
mulsd %xmm11, %xmm11
movsd %xmm11, -0xd0(%rcx,%rax)
movq -0x110(%rbp), %rdx
bswapq %rdx
movq %rdx, -0xc8(%rcx,%rax)
movsd %xmm10, -0xc0(%rcx,%rax)
movsd %xmm6, -0xb8(%rcx,%rax)
movsd %xmm9, -0xb0(%rcx,%rax)
movsd %xmm4, -0xa8(%rcx,%rax)
movsd %xmm2, -0xa0(%rcx,%rax)
movsd %xmm7, -0x98(%rcx,%rax)
movsd %xmm8, -0x90(%rcx,%rax)
movq -0x120(%rbp), %rdx
bswapq %rdx
movq -0x118(%rbp), %rdi
bswapq %rdi
movq %rdi, -0x88(%rcx,%rax)
movq %rdx, -0x80(%rcx,%rax)
movsd %xmm0, -0x78(%rcx,%rax)
movsd %xmm1, -0x70(%rcx,%rax)
movsd %xmm3, -0x68(%rcx,%rax)
movsd %xmm5, -0x60(%rcx,%rax)
movq -0x80(%rbp), %rdx
bswapq %rdx
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x58(%rcx,%rax)
movq -0x128(%rbp), %rdi
bswapq %rdi
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rcx,%rax)
movq %rdi, -0x48(%rcx,%rax)
movq %rdx, -0x40(%rcx,%rax)
movq -0x70(%rbp), %rdx
bswapq %rdx
movq %rdx, -0x38(%rcx,%rax)
movq -0x78(%rbp), %rdx
bswapq %rdx
movq %rdx, -0x30(%rcx,%rax)
xorpd %xmm0, %xmm0
andq $0x0, -0x8(%rcx,%rax)
movupd %xmm0, -0x18(%rcx,%rax)
movupd %xmm0, -0x28(%rcx,%rax)
movl %esi, 0x70e40(%r14)
pushq $0x2
popq %r15
jmp 0x312a3
movq %rbx, %rsi
movq %r14, %rdx
leal -0x1f8(%r15), %eax
cmpw $0x7, %ax
jae 0x324bf
movsd 0x30e50(%rip), %xmm0    # 0x63308
movsd %xmm0, -0x50(%rbp)
jmp 0x324da
movsd 0x30e49(%rip), %xmm0    # 0x63310
movsd %xmm0, -0x50(%rbp)
movq -0x58(%rbp), %rax
addl $0xfffffd10, %eax       # imm = 0xFFFFFD10
cmpl $0x5, %eax
jae 0x324e5
movq %rdx, %r14
movq %rsi, %rbx
jmp 0x32081
cmpl $0x1ff, -0x58(%rbp)     # imm = 0x1FF
movq %rdx, %r14
movq %rsi, %rbx
je 0x32081
leal -0x2f5(%r15), %eax
cmpw $0x7, %ax
jae 0x3250f
movsd 0x30e0b(%rip), %xmm0    # 0x63318
jmp 0x324b8
movl %r15d, %eax
andl $0xfffc, %eax           # imm = 0xFFFC
cmpw $0x2fc, %ax             # imm = 0x2FC
sete %al
leal -0x3f0(%r15), %ecx
cmpw $0x3, %cx
setb %cl
orb %al, %cl
je 0x3253d
movsd 0x30de8(%rip), %xmm0    # 0x63320
jmp 0x324b8
addl $0xfffffc0d, %r15d      # imm = 0xFFFFFC0D
xorl %eax, %eax
cmpw $0xa, %r15w
setb %al
leaq 0x30dd3(%rip), %rcx     # 0x63328
movsd (%rcx,%rax,8), %xmm0
jmp 0x324b8