// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/mmulti.c
// Function: getpacket
int getpacket (int *retother, unsigned char *bufptr)
{
	int i, j, k, ic0, crc16ofs, messleng, other;
	static int warned = 0;

	if (numplayers < 2) return(0);

	if (netready)
	{
		for(i=connecthead;i>=0;i=connectpoint2[i])
		{
			if (i != myconnectindex) dosendpackets(i);
			if ((networkmode == MMULTI_MODE_MS) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master
		}
	}

	tims = GetTickCount();

	while (netread(&other,pakbuf,sizeof(pakbuf)))
	{
			//Packet format:
			//   short crc16ofs;       //offset of crc16
			//   int icnt0;           //earliest unacked packet
			//   char ibits[32];       //ack status of packets icnt0<=i<icnt0+256
			//   while (short leng)    //leng: !=0 for packet, 0 for no more packets
			//   {
			//      int ocnt;         //index of following packet data
			//      char pak[leng];    //actual packet data :)
			//   }
			//   unsigned short crc16; //CRC16 of everything except crc16
		k = 0;
		crc16ofs = (int)(*(unsigned short *)&pakbuf[k]); k += 2;

		if (crc16ofs+2 > (int)sizeof(pakbuf)) {
#ifdef MMULTI_DEBUG_SENDRECV
			debugprintf("mmulti debug: wrong-sized packet from %d\n", other);
#endif
		} else if (getcrc16(pakbuf,crc16ofs) != (*(unsigned short *)&pakbuf[crc16ofs])) {
#ifdef MMULTI_DEBUG_SENDRECV
			debugprintf("mmulti debug: bad crc in packet from %d\n", other);
#endif
		} else {
			ic0 = *(int *)&pakbuf[k]; k += 4;
			if (ic0 == -1)
			{
				// Peers send each other 0xaa and respond with 0xab containing their opinion
				// of the requesting peer's placement within the order.

				// Slave sends 0xaa to Master at initmultiplayerscycle() and waits for 0xab response.
				// Master responds to slave with 0xab whenever it receives a 0xaa - even if during game!
				if (pakbuf[k] == 0xaa)
				{
					int sendother = -1;
#ifdef MMULTI_DEBUG_SENDRECV
					const char *addr = presentaddress((struct sockaddr *)&snatchhost);
#endif

					if (networkmode == MMULTI_MODE_MS) {
						// Master-slave.
						if (other == myconnectindex && myconnectindex == connecthead) {
							// This the master and someone new is calling. Find them a place.
#ifdef MMULTI_DEBUG_SENDRECV
							debugprintf("mmulti debug: got ping from new host %s\n", addr);
#endif
							for (other = 1; other < numplayers; other++) {
								if (otherhost[other].ss_family == PF_UNSPEC) {
									sendother = other;
#ifdef MMULTI_DEBUG_SENDRECV
									debugprintf("mmulti debug: giving %s player %d\n", addr, other);
#endif
									break;
								}
							}
						} else {
							// Repeat back to them their position.
#ifdef MMULTI_DEBUG_SENDRECV
							debugprintf("mmulti debug: got ping from player %d\n", other);
#endif
							sendother = other;
						}
					} else {
						// Peer-to-peer mode.
						if (other == myconnectindex) {
#ifdef MMULTI_DEBUG_SENDRECV
							debugprintf("mmulti debug: got ping from unknown host %s\n", addr);
#endif
						} else {
#ifdef MMULTI_DEBUG_SENDRECV
							debugprintf("mmulti debug: got ping from peer %d\n", other);
#endif
							sendother = other;
						}
					}

					if (sendother >= 0) {
						savesnatchhost(sendother);
						lastrecvtims[sendother] = tims;

							//   short crc16ofs;        //offset of crc16
							//   int icnt0;             //-1 (special packet for MMULTI.C's player collection)
							//   char type;				// 0xab
							//   char connectindex;
							//   char numplayers;
							//   char netready;
							//   unsigned short crc16;  //CRC16 of everything except crc16
						k = 2;
						*(int *)&pakbuf[k] = -1; k += 4;
						pakbuf[k++] = 0xab;
						pakbuf[k++] = (char)sendother;
						pakbuf[k++] = (char)numplayers;
						pakbuf[k++] = (char)netready;
						*(unsigned short *)&pakbuf[0] = (unsigned short)k;
						*(unsigned short *)&pakbuf[k] = getcrc16(pakbuf,k); k += 2;
						netsend(sendother,pakbuf,k);
					}
				}
				else if (pakbuf[k] == 0xab)
				{
					if (networkmode == MMULTI_MODE_MS) {
						// Master-slave.
						if (((unsigned int)pakbuf[k+1] < (unsigned int)pakbuf[k+2]) &&
							 ((unsigned int)pakbuf[k+2] < (unsigned int)MAXPLAYERS) &&
							 other == connecthead)
						{
#ifdef MMULTI_DEBUG_SENDRECV
								debugprintf("mmulti debug: master gave us player %d in a %d player game\n",
									(int)pakbuf[k+1], (int)pakbuf[k+2]);
#endif

							if ((int)pakbuf[k+1] != myconnectindex ||
									(int)pakbuf[k+2] != numplayers)
							{
								myconnectindex = (int)pakbuf[k+1];
								numplayers = (int)pakbuf[k+2];

								connecthead = 0;
								for(i=0;i<numplayers-1;i++) connectpoint2[i] = i+1;
								connectpoint2[numplayers-1] = -1;
							}

							netready = netready || (int)pakbuf[k+3];

							savesnatchhost(connecthead);
							lastrecvtims[connecthead] = tims;
						}
					} else {
						// Peer-to-peer. Verify that our peer's understanding of the
						// order and player count matches with ours.
						if (myconnectindex != (int)pakbuf[k+1] ||
								numplayers != (int)pakbuf[k+2]) {
							if (!warned) {
								const char *addr = presentaddress((struct sockaddr *)&snatchhost);
								printf("mmulti error: host %s (peer %d) believes this machine is "
									"player %d in a %d-player game! The game will not start until "
									"every machine is in agreement.\n",
									addr, other, (int)pakbuf[k+1], (int)pakbuf[k+2]);
							}
							warned = 1;
						} else {
							savesnatchhost(other);
							lastrecvtims[other] = tims;
						}
					}
				}
			}
			else
			{
				if (other == myconnectindex) {
#ifdef MMULTI_DEBUG_SENDRECV
					debugprintf("mmulti debug: got a packet from unknown host %s\n",
								presentaddress((struct sockaddr *)&snatchhost));
					return 0;
#endif
				}
				if (ocnt0[other] < ic0) ocnt0[other] = ic0;
				for(i=ic0;i<min(ic0+256,ocnt1[other]);i++)
					if (pakbuf[((i-ic0)>>3)+k]&(1<<((i-ic0)&7)))
						opak[other][i&(FIFSIZ-1)] = 0;
				k += 32;

				messleng = (int)(*(unsigned short *)&pakbuf[k]); k += 2;
				while (messleng)
				{
					j = *(int *)&pakbuf[k]; k += 4;
					if ((j >= icnt0[other]) && (!ipak[other][j&(FIFSIZ-1)]))
					{
						if (pakmemi+messleng+2 > (int)sizeof(pakmem)) pakmemi = 1;
						ipak[other][j&(FIFSIZ-1)] = pakmemi;
						*(short *)&pakmem[pakmemi] = messleng;
						memcpy(&pakmem[pakmemi+2],&pakbuf[k],messleng); pakmemi += messleng+2;
					}
					k += messleng;
					messleng = (int)(*(unsigned short *)&pakbuf[k]); k += 2;
				}

				lastrecvtims[other] = tims;
			}
		}
	}

		//Return next valid packet from any player
	if (!bufptr) return(0);
	for(i=connecthead;i>=0;i=connectpoint2[i])
	{
		if (i != myconnectindex)
		{
			j = ipak[i][icnt0[i]&(FIFSIZ-1)];
			if (j)
			{
				messleng = *(short *)&pakmem[j]; memcpy(bufptr,&pakmem[j+2],messleng);
				*retother = i; ipak[i][icnt0[i]&(FIFSIZ-1)] = 0; icnt0[i]++;
				return(messleng);
			}
		}
		if ((networkmode == MMULTI_MODE_MS) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master
	}

	return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpl $0x2, 0x71ca35(%rip)    # 0x7a4f4c
jge 0x88525
movl $0x0, -0x4(%rbp)
jmp 0x88dcb
cmpl $0x0, 0x71ca74(%rip)    # 0x7a4fa0
je 0x88580
movl 0x71ca1c(%rip), %eax    # 0x7a4f50
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0x8857e
movl -0x1c(%rbp), %eax
cmpl 0x71c9fe(%rip), %eax    # 0x7a4f44
je 0x88550
movl -0x1c(%rbp), %edi
callq 0x88ef0
cmpl $0x0, 0xa3ba9(%rip)     # 0x12c100
jne 0x88569
movl 0x71c9e5(%rip), %eax    # 0x7a4f44
cmpl 0x71c9eb(%rip), %eax    # 0x7a4f50
je 0x88569
jmp 0x8857e
jmp 0x8856b
movslq -0x1c(%rbp), %rcx
leaq 0x71c9ea(%rip), %rax    # 0x7a4f60
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rbp)
jmp 0x88537
jmp 0x88580
callq 0x88de0
movl %eax, 0x71ca19(%rip)    # 0x7a4fa4
leaq -0x34(%rbp), %rdi
leaq 0x71caea(%rip), %rsi    # 0x7a5080
movl $0x100, %edx            # imm = 0x100
callq 0x87190
cmpl $0x0, %eax
je 0x88c96
movl $0x0, -0x24(%rbp)
movslq -0x24(%rbp), %rcx
leaq 0x71cac5(%rip), %rax    # 0x7a5080
movzwl (%rax,%rcx), %eax
movl %eax, -0x2c(%rbp)
movl -0x24(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x24(%rbp)
movl -0x2c(%rbp), %eax
addl $0x2, %eax
cmpl $0x100, %eax            # imm = 0x100
jle 0x885dd
jmp 0x88c91
movl -0x2c(%rbp), %esi
leaq 0x71ca99(%rip), %rdi    # 0x7a5080
callq 0x88e40
movzwl %ax, %eax
movslq -0x2c(%rbp), %rdx
leaq 0x71ca86(%rip), %rcx    # 0x7a5080
movzwl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
je 0x88607
jmp 0x88c8f
movslq -0x24(%rbp), %rcx
leaq 0x71ca6e(%rip), %rax    # 0x7a5080
movl (%rax,%rcx), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x24(%rbp)
cmpl $-0x1, -0x28(%rbp)
jne 0x88a4a
movslq -0x24(%rbp), %rcx
leaq 0x71ca4a(%rip), %rax    # 0x7a5080
movzbl (%rax,%rcx), %eax
cmpl $0xaa, %eax
jne 0x887d7
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
cmpl $0x0, 0xa3aad(%rip)     # 0x12c100
jne 0x886b9
movl -0x34(%rbp), %eax
cmpl 0x71c8e6(%rip), %eax    # 0x7a4f44
jne 0x886b1
movl 0x71c8de(%rip), %eax    # 0x7a4f44
cmpl 0x71c8e4(%rip), %eax    # 0x7a4f50
jne 0x886b1
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl 0x71c8ce(%rip), %eax    # 0x7a4f4c
jge 0x886af
movslq -0x34(%rbp), %rcx
leaq 0x71bee5(%rip), %rax    # 0x7a4570
shlq $0x7, %rcx
addq %rcx, %rax
movzwl (%rax), %eax
cmpl $0x0, %eax
jne 0x886a2
movl -0x34(%rbp), %eax
movl %eax, -0x38(%rbp)
jmp 0x886af
jmp 0x886a4
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x88675
jmp 0x886b7
movl -0x34(%rbp), %eax
movl %eax, -0x38(%rbp)
jmp 0x886ce
movl -0x34(%rbp), %eax
cmpl 0x71c882(%rip), %eax    # 0x7a4f44
jne 0x886c6
jmp 0x886cc
movl -0x34(%rbp), %eax
movl %eax, -0x38(%rbp)
jmp 0x886ce
cmpl $0x0, -0x38(%rbp)
jl 0x887d2
movl -0x38(%rbp), %edi
callq 0x89370
movl 0x71c8be(%rip), %edx    # 0x7a4fa4
movslq -0x38(%rbp), %rcx
leaq 0x71c8bf(%rip), %rax    # 0x7a4fb0
movl %edx, (%rax,%rcx,4)
movl $0x2, -0x24(%rbp)
movslq -0x24(%rbp), %rcx
leaq 0x71c97a(%rip), %rax    # 0x7a5080
movl $0xffffffff, (%rax,%rcx) # imm = 0xFFFFFFFF
movl -0x24(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x24(%rbp)
movslq %eax, %rcx
leaq 0x71c955(%rip), %rax    # 0x7a5080
movb $-0x55, (%rax,%rcx)
movl -0x38(%rbp), %eax
movb %al, %dl
movl -0x24(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x24(%rbp)
movslq %eax, %rcx
leaq 0x71c937(%rip), %rax    # 0x7a5080
movb %dl, (%rax,%rcx)
movl 0x71c7fa(%rip), %eax    # 0x7a4f4c
movb %al, %dl
movl -0x24(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x24(%rbp)
movslq %eax, %rcx
leaq 0x71c917(%rip), %rax    # 0x7a5080
movb %dl, (%rax,%rcx)
movl 0x71c82e(%rip), %eax    # 0x7a4fa0
movb %al, %dl
movl -0x24(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x24(%rbp)
movslq %eax, %rcx
leaq 0x71c8f7(%rip), %rax    # 0x7a5080
movb %dl, (%rax,%rcx)
movl -0x24(%rbp), %eax
movw %ax, 0x71c8ea(%rip)     # 0x7a5080
movl -0x24(%rbp), %esi
leaq 0x71c8e0(%rip), %rdi    # 0x7a5080
callq 0x88e40
movw %ax, %dx
movslq -0x24(%rbp), %rcx
leaq 0x71c8cd(%rip), %rax    # 0x7a5080
movw %dx, (%rax,%rcx)
movl -0x24(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x24(%rbp)
movl -0x38(%rbp), %edi
movl -0x24(%rbp), %edx
leaq 0x71c8b3(%rip), %rsi    # 0x7a5080
callq 0x86e60
jmp 0x88a45
movslq -0x24(%rbp), %rcx
leaq 0x71c89e(%rip), %rax    # 0x7a5080
movzbl (%rax,%rcx), %eax
cmpl $0xab, %eax
jne 0x88a43
cmpl $0x0, 0xa3908(%rip)     # 0x12c100
jne 0x88984
movl -0x24(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x71c872(%rip), %rax    # 0x7a5080
movzbl (%rax,%rcx), %eax
movl -0x24(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rdx
leaq 0x71c85e(%rip), %rcx    # 0x7a5080
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jae 0x8897f
movl -0x24(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x71c842(%rip), %rax    # 0x7a5080
movzbl (%rax,%rcx), %eax
cmpl $0x10, %eax
jae 0x8897f
movl -0x34(%rbp), %eax
cmpl 0x71c6fc(%rip), %eax    # 0x7a4f50
jne 0x8897f
movl -0x24(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x71c816(%rip), %rax    # 0x7a5080
movzbl (%rax,%rcx), %eax
cmpl 0x71c6d0(%rip), %eax    # 0x7a4f44
jne 0x88896
movl -0x24(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x71c7fa(%rip), %rax    # 0x7a5080
movzbl (%rax,%rcx), %eax
cmpl 0x71c6bc(%rip), %eax    # 0x7a4f4c
je 0x88924
movl -0x24(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x71c7da(%rip), %rax    # 0x7a5080
movzbl (%rax,%rcx), %eax
movl %eax, 0x71c694(%rip)    # 0x7a4f44
movl -0x24(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x71c7c0(%rip), %rax    # 0x7a5080
movzbl (%rax,%rcx), %eax
movl %eax, 0x71c682(%rip)    # 0x7a4f4c
movl $0x0, 0x71c67c(%rip)    # 0x7a4f50
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl 0x71c668(%rip), %ecx    # 0x7a4f4c
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x8890a
movl -0x1c(%rbp), %edx
addl $0x1, %edx
movslq -0x1c(%rbp), %rcx
leaq 0x71c664(%rip), %rax    # 0x7a4f60
movl %edx, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x888db
movl 0x71c63c(%rip), %eax    # 0x7a4f4c
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x71c643(%rip), %rax    # 0x7a4f60
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
movb $0x1, %al
cmpl $0x0, 0x71c673(%rip)    # 0x7a4fa0
movb %al, -0x41(%rbp)
jne 0x8894f
movl -0x24(%rbp), %eax
addl $0x3, %eax
movslq %eax, %rcx
leaq 0x71c73e(%rip), %rax    # 0x7a5080
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x71c643(%rip)    # 0x7a4fa0
movl 0x71c5ed(%rip), %edi    # 0x7a4f50
callq 0x89370
movl 0x71c636(%rip), %edx    # 0x7a4fa4
movslq 0x71c5db(%rip), %rcx    # 0x7a4f50
leaq 0x71c634(%rip), %rax    # 0x7a4fb0
movl %edx, (%rax,%rcx,4)
jmp 0x88a41
movl 0x71c5ba(%rip), %eax    # 0x7a4f44
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rdx
leaq 0x71c6e6(%rip), %rcx    # 0x7a5080
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jne 0x889c0
movl 0x71c5a4(%rip), %eax    # 0x7a4f4c
movl -0x24(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rdx
leaq 0x71c6c8(%rip), %rcx    # 0x7a5080
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
je 0x88a23
cmpl $0x0, 0xb2c879(%rip)    # 0xbb5240
jne 0x88a17
leaq 0x71c4e0(%rip), %rdi    # 0x7a4eb0
callq 0x87f90
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rsi
movl -0x34(%rbp), %edx
movl -0x24(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x71c690(%rip), %rax    # 0x7a5080
movzbl (%rax,%rcx), %ecx
movl -0x24(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rdi
leaq 0x71c67c(%rip), %rax    # 0x7a5080
movzbl (%rax,%rdi), %r8d
leaq 0x68363(%rip), %rdi     # 0xf0d73
movb $0x0, %al
callq 0x52630
movl $0x1, 0xb2c81f(%rip)    # 0xbb5240
jmp 0x88a3f
movl -0x34(%rbp), %edi
callq 0x89370
movl 0x71c573(%rip), %edx    # 0x7a4fa4
movslq -0x34(%rbp), %rcx
leaq 0x71c574(%rip), %rax    # 0x7a4fb0
movl %edx, (%rax,%rcx,4)
jmp 0x88a41
jmp 0x88a43
jmp 0x88a45
jmp 0x88c8d
movl -0x34(%rbp), %eax
cmpl 0x71c4f1(%rip), %eax    # 0x7a4f44
jne 0x88a57
jmp 0x88a57
movslq -0x34(%rbp), %rcx
leaq 0x72475e(%rip), %rax    # 0x7ad1c0
movl (%rax,%rcx,4), %eax
cmpl -0x28(%rbp), %eax
jge 0x88a7b
movl -0x28(%rbp), %edx
movslq -0x34(%rbp), %rcx
leaq 0x724748(%rip), %rax    # 0x7ad1c0
movl %edx, (%rax,%rcx,4)
movl -0x28(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x28(%rbp), %eax
addl $0x100, %eax            # imm = 0x100
movslq -0x34(%rbp), %rdx
leaq 0x724766(%rip), %rcx    # 0x7ad200
cmpl (%rcx,%rdx,4), %eax
jge 0x88aac
movl -0x28(%rbp), %eax
addl $0x100, %eax            # imm = 0x100
movl %eax, -0x4c(%rbp)
jmp 0x88abd
movslq -0x34(%rbp), %rcx
leaq 0x724749(%rip), %rax    # 0x7ad200
movl (%rax,%rcx,4), %eax
movl %eax, -0x4c(%rbp)
movl -0x48(%rbp), %eax
movl -0x4c(%rbp), %ecx
cmpl %ecx, %eax
jge 0x88b2f
movl -0x1c(%rbp), %eax
subl -0x28(%rbp), %eax
sarl $0x3, %eax
addl -0x24(%rbp), %eax
movslq %eax, %rcx
leaq 0x71c5a3(%rip), %rax    # 0x7a5080
movzbl (%rax,%rcx), %eax
movl -0x1c(%rbp), %ecx
subl -0x28(%rbp), %ecx
andl $0x7, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x88b1f
movslq -0x34(%rbp), %rcx
leaq 0x72473b(%rip), %rax    # 0x7ad240
shlq $0xb, %rcx
addq %rcx, %rax
movl -0x1c(%rbp), %ecx
andl $0x1ff, %ecx            # imm = 0x1FF
movslq %ecx, %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x88b21
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x88a81
movl -0x24(%rbp), %eax
addl $0x20, %eax
movl %eax, -0x24(%rbp)
movslq -0x24(%rbp), %rcx
leaq 0x71c53d(%rip), %rax    # 0x7a5080
movzwl (%rax,%rcx), %eax
movl %eax, -0x30(%rbp)
movl -0x24(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x30(%rbp)
je 0x88c79
movslq -0x24(%rbp), %rcx
leaq 0x71c518(%rip), %rax    # 0x7a5080
movl (%rax,%rcx), %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
movslq -0x34(%rbp), %rdx
leaq 0x71c5fb(%rip), %rcx    # 0x7a5180
cmpl (%rcx,%rdx,4), %eax
jl 0x88c50
movslq -0x34(%rbp), %rcx
leaq 0x71c627(%rip), %rax    # 0x7a51c0
shlq $0xb, %rcx
addq %rcx, %rax
movl -0x20(%rbp), %ecx
andl $0x1ff, %ecx            # imm = 0x1FF
movslq %ecx, %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x88c50
movl 0xa354c(%rip), %eax     # 0x12c108
addl -0x30(%rbp), %eax
addl $0x2, %eax
cmpl $0x400000, %eax         # imm = 0x400000
jle 0x88bd3
movl $0x1, 0xa3535(%rip)     # 0x12c108
movl 0xa352f(%rip), %edx     # 0x12c108
movslq -0x34(%rbp), %rcx
leaq 0x71c5dc(%rip), %rax    # 0x7a51c0
shlq $0xb, %rcx
addq %rcx, %rax
movl -0x20(%rbp), %ecx
andl $0x1ff, %ecx            # imm = 0x1FF
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x30(%rbp), %eax
movw %ax, %dx
movslq 0xa3501(%rip), %rcx     # 0x12c108
leaq 0x72c632(%rip), %rax    # 0x7b5240
movw %dx, (%rax,%rcx)
movl 0xa34f0(%rip), %eax     # 0x12c108
addl $0x2, %eax
cltq
leaq 0x72c61c(%rip), %rdi    # 0x7b5240
addq %rax, %rdi
movslq -0x24(%rbp), %rax
leaq 0x71c44e(%rip), %rsi    # 0x7a5080
addq %rax, %rsi
movslq -0x30(%rbp), %rdx
callq 0x80e0
movl -0x30(%rbp), %eax
addl $0x2, %eax
addl 0xa34be(%rip), %eax     # 0x12c108
movl %eax, 0xa34b8(%rip)     # 0x12c108
movl -0x30(%rbp), %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movslq -0x24(%rbp), %rcx
leaq 0x71c41c(%rip), %rax    # 0x7a5080
movzwl (%rax,%rcx), %eax
movl %eax, -0x30(%rbp)
movl -0x24(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x24(%rbp)
jmp 0x88b53
movl 0x71c325(%rip), %edx    # 0x7a4fa4
movslq -0x34(%rbp), %rcx
leaq 0x71c326(%rip), %rax    # 0x7a4fb0
movl %edx, (%rax,%rcx,4)
jmp 0x88c8f
jmp 0x88c91
jmp 0x8858b
cmpq $0x0, -0x18(%rbp)
jne 0x88ca9
movl $0x0, -0x4(%rbp)
jmp 0x88dcb
movl 0x71c2a1(%rip), %eax    # 0x7a4f50
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0x88dc4
movl -0x1c(%rbp), %eax
cmpl 0x71c27f(%rip), %eax    # 0x7a4f44
je 0x88d93
movslq -0x1c(%rbp), %rcx
leaq 0x71c4ea(%rip), %rax    # 0x7a51c0
shlq $0xb, %rcx
addq %rcx, %rax
movslq -0x1c(%rbp), %rdx
leaq 0x71c498(%rip), %rcx    # 0x7a5180
movl (%rcx,%rdx,4), %ecx
andl $0x1ff, %ecx            # imm = 0x1FF
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x88d91
movslq -0x20(%rbp), %rcx
leaq 0x72c531(%rip), %rax    # 0x7b5240
movswl (%rax,%rcx), %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movl -0x20(%rbp), %eax
addl $0x2, %eax
cltq
leaq 0x72c517(%rip), %rsi    # 0x7b5240
addq %rax, %rsi
movslq -0x30(%rbp), %rdx
callq 0x80e0
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movslq -0x1c(%rbp), %rcx
leaq 0x71c477(%rip), %rax    # 0x7a51c0
shlq $0xb, %rcx
addq %rcx, %rax
movslq -0x1c(%rbp), %rdx
leaq 0x71c425(%rip), %rcx    # 0x7a5180
movl (%rcx,%rdx,4), %ecx
andl $0x1ff, %ecx            # imm = 0x1FF
movslq %ecx, %rcx
movl $0x0, (%rax,%rcx,4)
movslq -0x1c(%rbp), %rcx
leaq 0x71c407(%rip), %rax    # 0x7a5180
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
leaq 0x71c3fa(%rip), %rax    # 0x7a5180
movl %edx, (%rax,%rcx,4)
movl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x88dcb
jmp 0x88d93
cmpl $0x0, 0xa3366(%rip)     # 0x12c100
jne 0x88dac
movl 0x71c1a2(%rip), %eax    # 0x7a4f44
cmpl 0x71c1a8(%rip), %eax    # 0x7a4f50
je 0x88dac
jmp 0x88dc4
jmp 0x88dae
movslq -0x1c(%rbp), %rcx
leaq 0x71c1a7(%rip), %rax    # 0x7a4f60
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rbp)
jmp 0x88cb2
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)