// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/tektag.c
// Function: tektagload
void
tektagload(int fil)
{
     int  i;

     read(fil,&numanimates,sizeof(int));
     for (i=0 ; i < numanimates ; i++) {
          read(fil,&animpic[i],sizeof(struct animpic));
     }
     read(fil,&numdelayfuncs,sizeof(short));
     for (i=0 ; i < numdelayfuncs ; i++) {
          read(fil,&delayfunc[i],sizeof(struct delayfunc));
     }
     read(fil,onelev,MAXPLAYERS);
     read(fil,&secnt,sizeof(int));
     for (i=0 ; i < secnt ; i++) {
          read(fil,&sectoreffect[i],sizeof(struct sectoreffect));
     }
     read(fil,sexref,MAXSECTORS*sizeof(int));
     read(fil,&numdoors,sizeof(int));
     for (i=0 ; i < numdoors ; i++) {
          read(fil,&doortype[i],sizeof(struct doortype));
     }
     read(fil,&numfloordoors,sizeof(int));
     for (i=0 ; i < numfloordoors ; i++) {
          read(fil,&floordoor[i],sizeof(struct floordoor));
     }
     read(fil,fdxref,MAXSECTORS*sizeof(int));
     read(fil,&numvehicles,sizeof(int));
     for (i=0 ; i < numvehicles ; i++) {
          read(fil,&sectorvehicle[i],sizeof(struct sectorvehicle));
     }

     // must reinvoke vehicle sounds since all sounds were stopped
     // else updatevehiclesounds will update whatever is using
     // dsoundptr[vptr->soundindex]
     clearvehiclesoundindexes();

     read(fil,elevator,MAXSECTORS*sizeof(struct elevatortype));
     read(fil,&sprelevcnt,sizeof(int));
     for (i=0 ; i < sprelevcnt ; i++) {
          read(fil,&spriteelev[i],sizeof(struct spriteelev));
     }
     read(fil,&totalmapsndfx,sizeof(int));
     for (i=0 ; i < totalmapsndfx ; i++) {
          read(fil,&mapsndfx[i],sizeof(struct mapsndfxtype));
          // did we leave with a TOGGLED sound playong ?
          if( (mapsndfx[i].type == MAP_SFX_TOGGLED) && (mapsndfx[i].id != -1) ) {
               mapsndfxptr[i]->id=playsound(mapsndfxptr[i]->snum, mapsndfxptr[i]->x,mapsndfxptr[i]->y, mapsndfxptr[i]->loops, ST_UNIQUE);
          }
     }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x2ffe54(%rip), %rsi    # 0x32e424
movl $0x4, %edx
callq 0x8b20
cmpl $0x0, 0x2ffe43(%rip)    # 0x32e424
jle 0x2e60f
leaq 0x2ffe46(%rip), %r14    # 0x32e430
xorl %r15d, %r15d
movl $0x18, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x8b20
incq %r15
movslq 0x2ffe1e(%rip), %rax    # 0x32e424
addq $0x18, %r14
cmpq %rax, %r15
jl 0x2e5ed
leaq 0x30021a(%rip), %rsi    # 0x32e830
movl $0x2, %edx
movl %ebx, %edi
callq 0x8b20
cmpw $0x0, 0x300206(%rip)    # 0x32e830
jle 0x2e659
leaq 0x30020d(%rip), %r14    # 0x32e840
xorl %r15d, %r15d
movl $0x10, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x8b20
incq %r15
movswq 0x3001e0(%rip), %rax    # 0x32e830
addq $0x10, %r14
cmpq %rax, %r15
jl 0x2e636
leaq 0x3004f0(%rip), %rsi    # 0x32eb50
movl $0x10, %edx
movl %ebx, %edi
callq 0x8b20
leaq 0x291e81(%rip), %rsi    # 0x2c04f4
movl $0x4, %edx
movl %ebx, %edi
callq 0x8b20
cmpl $0x0, 0x291e6e(%rip)    # 0x2c04f4
jle 0x2e6b4
leaq 0x295e71(%rip), %r14    # 0x2c4500
xorl %r15d, %r15d
movl $0x3c, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x8b20
incq %r15
movslq 0x291e49(%rip), %rax    # 0x2c04f4
addq $0x3c, %r14
cmpq %rax, %r15
jl 0x2e692
leaq 0x291e45(%rip), %rsi    # 0x2c0500
movl $0x4000, %edx           # imm = 0x4000
movl %ebx, %edi
callq 0x8b20
leaq 0x2f3d42(%rip), %rsi    # 0x322410
movl $0x4, %edx
movl %ebx, %edi
callq 0x8b20
cmpl $0x0, 0x2f3d2f(%rip)    # 0x322410
jle 0x2e70f
leaq 0x2e1e16(%rip), %r14    # 0x310500
xorl %r15d, %r15d
movl $0x64, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x8b20
incq %r15
movslq 0x2f3d0a(%rip), %rax    # 0x322410
addq $0x64, %r14
cmpq %rax, %r15
jl 0x2e6ed
leaq 0x2e724a(%rip), %rsi    # 0x315960
movl $0x4, %edx
movl %ebx, %edi
callq 0x8b20
cmpl $0x0, 0x2e7237(%rip)    # 0x315960
jle 0x2e757
leaq 0x2eb23e(%rip), %r14    # 0x319970
xorl %r15d, %r15d
movl $0x1c, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x8b20
incq %r15
movslq 0x2e7212(%rip), %rax    # 0x315960
addq $0x1c, %r14
cmpq %rax, %r15
jl 0x2e735
leaq 0x2e7212(%rip), %rsi    # 0x315970
movl $0x4000, %edx           # imm = 0x4000
movl %ebx, %edi
callq 0x8b20
leaq 0x2ed76f(%rip), %rsi    # 0x31bee0
movl $0x4, %edx
movl %ebx, %edi
callq 0x8b20
cmpl $0x0, 0x2ed75c(%rip)    # 0x31bee0
jle 0x2e7b5
leaq 0x2ed763(%rip), %r14    # 0x31bef0
xorl %r15d, %r15d
movl $0xa14, %edx            # imm = 0xA14
movl %ebx, %edi
movq %r14, %rsi
callq 0x8b20
incq %r15
movslq 0x2ed737(%rip), %rax    # 0x31bee0
addq $0xa14, %r14            # imm = 0xA14
cmpq %rax, %r15
jl 0x2e790
xorl %eax, %eax
leaq 0x2f3c02(%rip), %rcx    # 0x3223c0
movq (%rax,%rcx), %rdx
movl $0xffffffff, 0xa10(%rdx) # imm = 0xFFFFFFFF
addq $0x8, %rax
cmpq $0x50, %rax
jne 0x2e7be
leaq 0x2f3c43(%rip), %rsi    # 0x322420
movl $0x8000, %edx           # imm = 0x8000
movl %ebx, %edi
callq 0x8b20
leaq 0x2ffc30(%rip), %rsi    # 0x32e420
movl $0x4, %edx
movl %ebx, %edi
callq 0x8b20
cmpl $0x0, 0x2ffc1d(%rip)    # 0x32e420
jle 0x2e834
leaq 0x2eb4f4(%rip), %r14    # 0x319d00
xorl %r15d, %r15d
movl $0x124, %edx            # imm = 0x124
movl %ebx, %edi
movq %r14, %rsi
callq 0x8b20
incq %r15
movslq 0x2ffbf8(%rip), %rax    # 0x32e420
addq $0x124, %r14            # imm = 0x124
cmpq %rax, %r15
jl 0x2e80f
leaq 0x291cb5(%rip), %rsi    # 0x2c04f0
movl $0x4, %edx
movl %ebx, %edi
callq 0x8b20
cmpl $0x0, 0x291ca2(%rip)    # 0x2c04f0
jle 0x2e8b4
leaq 0x2ed589(%rip), %r15    # 0x31bde0
leaq 0x2ed202(%rip), %r14    # 0x31ba60
xorl %r12d, %r12d
movl $0x1c, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x8b20
cmpl $0x2, 0x14(%r14)
jne 0x2e89d
cmpl $-0x1, 0x18(%r14)
je 0x2e89d
movq (%r15), %rax
movl 0xc(%rax), %edi
movl (%rax), %esi
movl 0x4(%rax), %edx
movl 0x10(%rax), %ecx
movl $0x8, %r8d
callq 0x1c370
movq (%r15), %rcx
movl %eax, 0x18(%rcx)
incq %r12
movslq 0x291c49(%rip), %rax    # 0x2c04f0
addq $0x8, %r15
addq $0x1c, %r14
cmpq %rax, %r12
jl 0x2e861
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq