// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/mmulti.c
// Function: dosendpackets
void dosendpackets (int other)
{
	int i, j, k;

	if (otherhost[other].ss_family == AF_UNSPEC) return;

		//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


	tims = GetTickCount();
	if (tims < lastsendtims[other]) lastsendtims[other] = tims;
	if (tims < lastsendtims[other]+1000/PAKRATE) return;
	lastsendtims[other] = tims;

	k = 2;
	*(int *)&pakbuf[k] = icnt0[other]; k += 4;
	memset(&pakbuf[k],0,32);
	for(i=icnt0[other];i<icnt0[other]+256;i++)
		if (ipak[other][i&(FIFSIZ-1)])
			pakbuf[((i-icnt0[other])>>3)+k] |= (1<<((i-icnt0[other])&7));
	k += 32;

	while ((ocnt0[other] < ocnt1[other]) && (!opak[other][ocnt0[other]&(FIFSIZ-1)])) ocnt0[other]++;
	for(i=ocnt0[other];i<ocnt1[other];i++)
	{
		j = *(short *)&pakmem[opak[other][i&(FIFSIZ-1)]]; if (!j) continue; //packet already acked
		if (k+6+j+4 > (int)sizeof(pakbuf)) break;

		*(unsigned short *)&pakbuf[k] = (unsigned short)j; k += 2;
		*(int *)&pakbuf[k] = i; k += 4;
		memcpy(&pakbuf[k],&pakmem[opak[other][i&(FIFSIZ-1)]+2],j); k += j;
	}
	*(unsigned short *)&pakbuf[k] = 0; k += 2;
	*(unsigned short *)&pakbuf[0] = (unsigned short)k;
	*(unsigned short *)&pakbuf[k] = getcrc16(pakbuf,k); k += 2;
	netsend(other,pakbuf,k);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x71b66a(%rip), %rax    # 0x7a4570
shlq $0x7, %rcx
addq %rcx, %rax
movzwl (%rax), %eax
cmpl $0x0, %eax
jne 0x88f1a
jmp 0x89273
callq 0x88de0
movl %eax, 0x71c07f(%rip)    # 0x7a4fa4
movl 0x71c079(%rip), %eax    # 0x7a4fa4
movslq -0x4(%rbp), %rdx
leaq 0x71c10a(%rip), %rcx    # 0x7a5040
cmpl (%rcx,%rdx,4), %eax
jge 0x88f4f
movl 0x71c063(%rip), %edx    # 0x7a4fa4
movslq -0x4(%rbp), %rcx
leaq 0x71c0f4(%rip), %rax    # 0x7a5040
movl %edx, (%rax,%rcx,4)
movl 0x71c04f(%rip), %eax    # 0x7a4fa4
movslq -0x4(%rbp), %rdx
leaq 0x71c0e0(%rip), %rcx    # 0x7a5040
movl (%rcx,%rdx,4), %ecx
addl $0x19, %ecx
cmpl %ecx, %eax
jge 0x88f6f
jmp 0x89273
movl 0x71c02f(%rip), %edx    # 0x7a4fa4
movslq -0x4(%rbp), %rcx
leaq 0x71c0c0(%rip), %rax    # 0x7a5040
movl %edx, (%rax,%rcx,4)
movl $0x2, -0x10(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x71c1eb(%rip), %rax    # 0x7a5180
movl (%rax,%rcx,4), %edx
movslq -0x10(%rbp), %rcx
leaq 0x71c0dd(%rip), %rax    # 0x7a5080
movl %edx, (%rax,%rcx)
movl -0x10(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x10(%rbp)
movslq -0x10(%rbp), %rax
leaq 0x71c0c6(%rip), %rdi    # 0x7a5080
addq %rax, %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x8410
movslq -0x4(%rbp), %rcx
leaq 0x71c1ac(%rip), %rax    # 0x7a5180
movl (%rax,%rcx,4), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movslq -0x4(%rbp), %rdx
leaq 0x71c198(%rip), %rcx    # 0x7a5180
movl (%rcx,%rdx,4), %ecx
addl $0x100, %ecx            # imm = 0x100
cmpl %ecx, %eax
jge 0x8907b
movslq -0x4(%rbp), %rcx
leaq 0x71c1bc(%rip), %rax    # 0x7a51c0
shlq $0xb, %rcx
addq %rcx, %rax
movl -0x8(%rbp), %ecx
andl $0x1ff, %ecx            # imm = 0x1FF
movslq %ecx, %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x8906b
movl -0x8(%rbp), %ecx
movslq -0x4(%rbp), %rdx
leaq 0x71c155(%rip), %rax    # 0x7a5180
subl (%rax,%rdx,4), %ecx
andl $0x7, %ecx
movl $0x1, %edx
shll %cl, %edx
movl -0x8(%rbp), %eax
movslq -0x4(%rbp), %rsi
leaq 0x71c13a(%rip), %rcx    # 0x7a5180
subl (%rcx,%rsi,4), %eax
sarl $0x3, %eax
addl -0x10(%rbp), %eax
movslq %eax, %rcx
leaq 0x71c027(%rip), %rax    # 0x7a5080
movzbl (%rax,%rcx), %eax
orl %edx, %eax
movb %al, %dl
leaq 0x71c018(%rip), %rax    # 0x7a5080
movb %dl, (%rax,%rcx)
jmp 0x8906d
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x88fda
movl -0x10(%rbp), %eax
addl $0x20, %eax
movl %eax, -0x10(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x724131(%rip), %rax    # 0x7ad1c0
movl (%rax,%rcx,4), %ecx
movslq -0x4(%rbp), %rsi
xorl %eax, %eax
leaq 0x724161(%rip), %rdx    # 0x7ad200
cmpl (%rdx,%rsi,4), %ecx
movb %al, -0x11(%rbp)
jge 0x890dc
movslq -0x4(%rbp), %rcx
leaq 0x72418e(%rip), %rax    # 0x7ad240
shlq $0xb, %rcx
addq %rcx, %rax
movslq -0x4(%rbp), %rdx
leaq 0x7240fc(%rip), %rcx    # 0x7ad1c0
movl (%rcx,%rdx,4), %ecx
andl $0x1ff, %ecx            # imm = 0x1FF
movslq %ecx, %rcx
cmpl $0x0, (%rax,%rcx,4)
setne %al
xorb $-0x1, %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
testb $0x1, %al
jne 0x890e5
jmp 0x89102
movslq -0x4(%rbp), %rcx
leaq 0x7240d0(%rip), %rax    # 0x7ad1c0
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
leaq 0x7240c3(%rip), %rax    # 0x7ad1c0
movl %edx, (%rax,%rcx,4)
jmp 0x89084
movslq -0x4(%rbp), %rcx
leaq 0x7240b3(%rip), %rax    # 0x7ad1c0
movl (%rax,%rcx,4), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movslq -0x4(%rbp), %rdx
leaq 0x7240df(%rip), %rcx    # 0x7ad200
cmpl (%rcx,%rdx,4), %eax
jge 0x89213
movslq -0x4(%rbp), %rcx
leaq 0x72410b(%rip), %rax    # 0x7ad240
shlq $0xb, %rcx
addq %rcx, %rax
movl -0x8(%rbp), %ecx
andl $0x1ff, %ecx            # imm = 0x1FF
movslq %ecx, %rcx
movslq (%rax,%rcx,4), %rcx
leaq 0x72c0ed(%rip), %rax    # 0x7b5240
movswl (%rax,%rcx), %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x89165
jmp 0x89205
movl -0x10(%rbp), %eax
addl $0x6, %eax
addl -0xc(%rbp), %eax
addl $0x4, %eax
cmpl $0x100, %eax            # imm = 0x100
jle 0x8917d
jmp 0x89213
movl -0xc(%rbp), %eax
movw %ax, %dx
movslq -0x10(%rbp), %rcx
leaq 0x71bef2(%rip), %rax    # 0x7a5080
movw %dx, (%rax,%rcx)
movl -0x10(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x10(%rbp)
movl -0x8(%rbp), %edx
movslq -0x10(%rbp), %rcx
leaq 0x71bed7(%rip), %rax    # 0x7a5080
movl %edx, (%rax,%rcx)
movl -0x10(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x10(%rbp)
movslq -0x10(%rbp), %rax
leaq 0x71bec0(%rip), %rdi    # 0x7a5080
addq %rax, %rdi
movslq -0x4(%rbp), %rcx
leaq 0x724072(%rip), %rax    # 0x7ad240
shlq $0xb, %rcx
addq %rcx, %rax
movl -0x8(%rbp), %ecx
andl $0x1ff, %ecx            # imm = 0x1FF
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
addl $0x2, %eax
cltq
leaq 0x72c050(%rip), %rsi    # 0x7b5240
addq %rax, %rsi
movslq -0xc(%rbp), %rdx
callq 0x80e0
movl -0xc(%rbp), %eax
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x89113
movslq -0x10(%rbp), %rcx
leaq 0x71be62(%rip), %rax    # 0x7a5080
movw $0x0, (%rax,%rcx)
movl -0x10(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movw %ax, 0x71be49(%rip)     # 0x7a5080
movl -0x10(%rbp), %esi
leaq 0x71be3f(%rip), %rdi    # 0x7a5080
callq 0x88e40
movw %ax, %dx
movslq -0x10(%rbp), %rcx
leaq 0x71be2c(%rip), %rax    # 0x7a5080
movw %dx, (%rax,%rcx)
movl -0x10(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x10(%rbp)
movl -0x4(%rbp), %edi
movl -0x10(%rbp), %edx
leaq 0x71be12(%rip), %rsi    # 0x7a5080
callq 0x86e60
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)