// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekmsc.c
// Function: nextnetlevel
void
nextnetlevel()
{
     int  i,len,other,readyplayers,playerreadyflag[MAXPLAYERS];

     if( strcmp(boardfilename,"NET1.MAP") == 0) {
          strcpy(boardfilename,"NET2.MAP");
     }
     else if( strcmp(boardfilename,"NET2.MAP") == 0) {
          strcpy(boardfilename,"NET3.MAP");
     }
     else if( strcmp(boardfilename,"NET3.MAP") == 0) {
          strcpy(boardfilename,"NET4.MAP");
     }
     else if( strcmp(boardfilename,"NET4.MAP") == 0) {
          strcpy(boardfilename,"NET6.MAP");
     }
     else if( strcmp(boardfilename,"NET6.MAP") == 0) {
          strcpy(boardfilename,"NET7.MAP");
     }
     else if( strcmp(boardfilename,"NET7.MAP") == 0) {
          strcpy(boardfilename,"NET5.MAP");
     }
     else if( strcmp(boardfilename,"NET5.MAP") == 0) {
          strcpy(boardfilename,"NET1.MAP");
     }
     initpaletteshifts();
     prepareboard(boardfilename);
     precache();
     for( i=connecthead ; i >= 0 ; i=connectpoint2[i] ) {
          initplayersprite((short)i);
     }
//** Les START - 10/02/95
     for (i=connecthead ; i >= 0 ; i=connectpoint2[i]) {
          playerreadyflag[i]=0;
     }
#if 0
     for (i=connecthead ; i >= 0 ; i=connectpoint2[i]) {
          syncvel[i]=fsyncvel[i]=osyncvel[i]=0;
          syncsvel[i]=fsyncsvel[i]=osyncsvel[i]=0;
          syncangvel[i]=fsyncangvel[i]=osyncangvel[i]=0;
          syncbits[i]=fsyncbits[i]=osyncbits[i]=0;
          for (j=0 ; j < MOVEFIFOSIZ ; j++) {
               baksyncvel[j][i]=0;
               baksyncsvel[j][i]=0;
               baksyncangvel[j][i]=0;
               baksyncbits[j][i]=0;
          }
     }
     movefifoplc=movefifoend=0;
     syncvalplc=othersyncvalplc=0;
     syncvalend=othersyncvalend=0;
     syncvalcnt=othersyncvalcnt=0L;
     olocvel=olocvel2=0;
     olocsvel=olocsvel2=0;
     olocangvel=olocangvel2=0;
     olocbits=olocbits2=0;
#endif
     randomseed=17L;
     keystatus[0x01]=0;
     memset(playerreadyflag,0,sizeof(int)*MAXPLAYERS);
     readyplayers=0;
     if (myconnectindex == connecthead) {
          playerreadyflag[myconnectindex]=1;
          do {
               if ((len=getpacket(&other,tempbuf)) > 0) {
                    playerreadyflag[other]=1;
               }
               readyplayers=0;
               for (i=connecthead ; i >= 0 ; i=connectpoint2[i]) {
                    if (playerreadyflag[i]) {
                         readyplayers++;
                    }
               }
               showmessage("%d OF %d PLAYERS READY..",readyplayers,numplayers);
               drawscreen(screenpeek,0L);
          } while (readyplayers < numplayers && keystatus[0x01] == 0);
          if (keystatus[0x01]) {
               keystatus[0x01]=0;
               crashgame("Multiplayer game aborted!");
          }
          if (dbgflag) {
               fprintf(dbgfp,"\nNEW LEVEL\n\n");
          }
     }
     else {
          showmessage("ONE MOMENT...");
          if (dbgflag) {
               fprintf(dbgfp,"\nNEW LEVEL\n\n");
          }
     }
//** Les END   - 10/02/95
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
leaq 0x112fa1(%rip), %rdi    # 0x12e7d0
leaq 0xbe0c2(%rip), %rsi     # 0xd98f8
callq 0x8b90
cmpl $0x0, %eax
jne 0x1b858
leaq 0x112f89(%rip), %rdi    # 0x12e7d0
leaq 0xbe0b3(%rip), %rsi     # 0xd9901
callq 0x8550
jmp 0x1b979
leaq 0x112f71(%rip), %rdi    # 0x12e7d0
leaq 0xbe09b(%rip), %rsi     # 0xd9901
callq 0x8b90
cmpl $0x0, %eax
jne 0x1b888
leaq 0x112f59(%rip), %rdi    # 0x12e7d0
leaq 0xbe08c(%rip), %rsi     # 0xd990a
callq 0x8550
jmp 0x1b977
leaq 0x112f41(%rip), %rdi    # 0x12e7d0
leaq 0xbe074(%rip), %rsi     # 0xd990a
callq 0x8b90
cmpl $0x0, %eax
jne 0x1b8b8
leaq 0x112f29(%rip), %rdi    # 0x12e7d0
leaq 0xbe065(%rip), %rsi     # 0xd9913
callq 0x8550
jmp 0x1b975
leaq 0x112f11(%rip), %rdi    # 0x12e7d0
leaq 0xbe04d(%rip), %rsi     # 0xd9913
callq 0x8b90
cmpl $0x0, %eax
jne 0x1b8e8
leaq 0x112ef9(%rip), %rdi    # 0x12e7d0
leaq 0xbe03e(%rip), %rsi     # 0xd991c
callq 0x8550
jmp 0x1b973
leaq 0x112ee1(%rip), %rdi    # 0x12e7d0
leaq 0xbe026(%rip), %rsi     # 0xd991c
callq 0x8b90
cmpl $0x0, %eax
jne 0x1b915
leaq 0x112ec9(%rip), %rdi    # 0x12e7d0
leaq 0xbe017(%rip), %rsi     # 0xd9925
callq 0x8550
jmp 0x1b971
leaq 0x112eb4(%rip), %rdi    # 0x12e7d0
leaq 0xbe002(%rip), %rsi     # 0xd9925
callq 0x8b90
cmpl $0x0, %eax
jne 0x1b942
leaq 0x112e9c(%rip), %rdi    # 0x12e7d0
leaq 0xbdff3(%rip), %rsi     # 0xd992e
callq 0x8550
jmp 0x1b96f
leaq 0x112e87(%rip), %rdi    # 0x12e7d0
leaq 0xbdfde(%rip), %rsi     # 0xd992e
callq 0x8b90
cmpl $0x0, %eax
jne 0x1b96d
leaq 0x112e6f(%rip), %rdi    # 0x12e7d0
leaq 0xbdf90(%rip), %rsi     # 0xd98f8
callq 0x8550
jmp 0x1b96f
jmp 0x1b971
jmp 0x1b973
jmp 0x1b975
jmp 0x1b977
jmp 0x1b979
callq 0x19830
leaq 0x112e4b(%rip), %rdi    # 0x12e7d0
callq 0x22220
movb $0x0, %al
callq 0x9680
leaq 0x7895b8(%rip), %rax    # 0x7a4f50
movl (%rax), %eax
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jl 0x1b9c1
movl -0x4(%rbp), %eax
movswl %ax, %edi
callq 0x24f80
movslq -0x4(%rbp), %rcx
leaq 0x7895a7(%rip), %rax    # 0x7a4f60
movl (%rax,%rcx,4), %eax
movl %eax, -0x4(%rbp)
jmp 0x1b99d
leaq 0x789588(%rip), %rax    # 0x7a4f50
movl (%rax), %eax
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jl 0x1b9f2
movslq -0x4(%rbp), %rax
movl $0x0, -0x50(%rbp,%rax,4)
movslq -0x4(%rbp), %rcx
leaq 0x789576(%rip), %rax    # 0x7a4f60
movl (%rax,%rcx,4), %eax
movl %eax, -0x4(%rbp)
jmp 0x1b9cd
leaq 0x6126af(%rip), %rax    # 0x62e0a8
movl $0x11, (%rax)
leaq 0x35c6ca(%rip), %rax    # 0x3780d0
movb $0x0, 0x1(%rax)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x8410
movl $0x0, -0x10(%rbp)
leaq 0x78951c(%rip), %rax    # 0x7a4f44
movl (%rax), %eax
leaq 0x78951f(%rip), %rcx    # 0x7a4f50
cmpl (%rcx), %eax
jne 0x1bb5a
leaq 0x789504(%rip), %rax    # 0x7a4f44
movslq (%rax), %rax
movl $0x1, -0x50(%rbp,%rax,4)
leaq -0xc(%rbp), %rdi
leaq 0x111f1a(%rip), %rsi    # 0x12d970
callq 0x88500
movl %eax, -0x8(%rbp)
cmpl $0x0, %eax
jle 0x1ba6f
movslq -0xc(%rbp), %rax
movl $0x1, -0x50(%rbp,%rax,4)
movl $0x0, -0x10(%rbp)
leaq 0x7894d3(%rip), %rax    # 0x7a4f50
movl (%rax), %eax
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jl 0x1bab1
movslq -0x4(%rbp), %rax
cmpl $0x0, -0x50(%rbp,%rax,4)
je 0x1ba9c
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x1ba9e
movslq -0x4(%rbp), %rcx
leaq 0x7894b7(%rip), %rax    # 0x7a4f60
movl (%rax,%rcx,4), %eax
movl %eax, -0x4(%rbp)
jmp 0x1ba82
movl -0x10(%rbp), %esi
leaq 0x789491(%rip), %rax    # 0x7a4f4c
movl (%rax), %edx
leaq 0xbde73(%rip), %rdi     # 0xd9937
movb $0x0, %al
callq 0x1a150
xorl %esi, %esi
leaq 0x111d0a(%rip), %rax    # 0x12d7de
movswl (%rax), %edi
callq 0xb170
movl -0x10(%rbp), %ecx
xorl %eax, %eax
leaq 0x789464(%rip), %rdx    # 0x7a4f4c
cmpl (%rdx), %ecx
movb %al, -0x51(%rbp)
jge 0x1bb03
leaq 0x35c5da(%rip), %rax    # 0x3780d0
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
sete %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0x1ba4b
leaq 0x35c5bb(%rip), %rax    # 0x3780d0
cmpb $0x0, 0x1(%rax)
je 0x1bb34
leaq 0x35c5ae(%rip), %rax    # 0x3780d0
movb $0x0, 0x1(%rax)
leaq 0xbde23(%rip), %rdi     # 0xd9950
movb $0x0, %al
callq 0x44240
leaq 0x111e29(%rip), %rax    # 0x12d964
cmpl $0x0, (%rax)
je 0x1bb58
leaq 0x111cb9(%rip), %rax    # 0x12d800
movq (%rax), %rdi
leaq 0xbde19(%rip), %rsi     # 0xd996a
movb $0x0, %al
callq 0x8280
jmp 0x1bb8e
leaq 0xbde16(%rip), %rdi     # 0xd9977
movb $0x0, %al
callq 0x1a150
leaq 0x111df5(%rip), %rax    # 0x12d964
cmpl $0x0, (%rax)
je 0x1bb8c
leaq 0x111c85(%rip), %rax    # 0x12d800
movq (%rax), %rdi
leaq 0xbdde5(%rip), %rsi     # 0xd996a
movb $0x0, %al
callq 0x8280
jmp 0x1bb8e
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)