// File: /workspace/github_c_makefile_star2_O1/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 0x2fe160(%rip), %rsi    # 0x32b404
movl $0x4, %edx
callq 0x8b20
cmpl $0x0, 0x2fe14f(%rip)    # 0x32b404
jle 0x2d2e3
leaq 0x2fe152(%rip), %r14    # 0x32b410
xorl %r15d, %r15d
movl $0x18, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x8b20
incq %r15
movslq 0x2fe12a(%rip), %rax    # 0x32b404
addq $0x18, %r14
cmpq %rax, %r15
jl 0x2d2c1
leaq 0x2fe526(%rip), %rsi    # 0x32b810
movl $0x2, %edx
movl %ebx, %edi
callq 0x8b20
cmpw $0x0, 0x2fe512(%rip)    # 0x32b810
jle 0x2d32d
leaq 0x2fe519(%rip), %r14    # 0x32b820
xorl %r15d, %r15d
movl $0x10, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x8b20
incq %r15
movswq 0x2fe4ec(%rip), %rax    # 0x32b810
addq $0x10, %r14
cmpq %rax, %r15
jl 0x2d30a
leaq 0x2fe7fc(%rip), %rsi    # 0x32bb30
movl $0x10, %edx
movl %ebx, %edi
callq 0x8b20
leaq 0x29018d(%rip), %rsi    # 0x2bd4d4
movl $0x4, %edx
movl %ebx, %edi
callq 0x8b20
cmpl $0x0, 0x29017a(%rip)    # 0x2bd4d4
jle 0x2d388
leaq 0x29417d(%rip), %r14    # 0x2c14e0
xorl %r15d, %r15d
movl $0x3c, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x8b20
incq %r15
movslq 0x290155(%rip), %rax    # 0x2bd4d4
addq $0x3c, %r14
cmpq %rax, %r15
jl 0x2d366
leaq 0x290151(%rip), %rsi    # 0x2bd4e0
movl $0x4000, %edx           # imm = 0x4000
movl %ebx, %edi
callq 0x8b20
leaq 0x2f204e(%rip), %rsi    # 0x31f3f0
movl $0x4, %edx
movl %ebx, %edi
callq 0x8b20
cmpl $0x0, 0x2f203b(%rip)    # 0x31f3f0
jle 0x2d3e3
leaq 0x2e0122(%rip), %r14    # 0x30d4e0
xorl %r15d, %r15d
movl $0x64, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x8b20
incq %r15
movslq 0x2f2016(%rip), %rax    # 0x31f3f0
addq $0x64, %r14
cmpq %rax, %r15
jl 0x2d3c1
leaq 0x2e5556(%rip), %rsi    # 0x312940
movl $0x4, %edx
movl %ebx, %edi
callq 0x8b20
cmpl $0x0, 0x2e5543(%rip)    # 0x312940
jle 0x2d42b
leaq 0x2e954a(%rip), %r14    # 0x316950
xorl %r15d, %r15d
movl $0x1c, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x8b20
incq %r15
movslq 0x2e551e(%rip), %rax    # 0x312940
addq $0x1c, %r14
cmpq %rax, %r15
jl 0x2d409
leaq 0x2e551e(%rip), %rsi    # 0x312950
movl $0x4000, %edx           # imm = 0x4000
movl %ebx, %edi
callq 0x8b20
leaq 0x2eba7b(%rip), %rsi    # 0x318ec0
movl $0x4, %edx
movl %ebx, %edi
callq 0x8b20
cmpl $0x0, 0x2eba68(%rip)    # 0x318ec0
jle 0x2d489
leaq 0x2eba6f(%rip), %r14    # 0x318ed0
xorl %r15d, %r15d
movl $0xa14, %edx            # imm = 0xA14
movl %ebx, %edi
movq %r14, %rsi
callq 0x8b20
incq %r15
movslq 0x2eba43(%rip), %rax    # 0x318ec0
addq $0xa14, %r14            # imm = 0xA14
cmpq %rax, %r15
jl 0x2d464
xorl %eax, %eax
leaq 0x2f1f0e(%rip), %rcx    # 0x31f3a0
movq (%rax,%rcx), %rdx
movl $0xffffffff, 0xa10(%rdx) # imm = 0xFFFFFFFF
addq $0x8, %rax
cmpq $0x50, %rax
jne 0x2d492
leaq 0x2f1f4f(%rip), %rsi    # 0x31f400
movl $0x8000, %edx           # imm = 0x8000
movl %ebx, %edi
callq 0x8b20
leaq 0x2fdf3c(%rip), %rsi    # 0x32b400
movl $0x4, %edx
movl %ebx, %edi
callq 0x8b20
cmpl $0x0, 0x2fdf29(%rip)    # 0x32b400
jle 0x2d508
leaq 0x2e9800(%rip), %r14    # 0x316ce0
xorl %r15d, %r15d
movl $0x124, %edx            # imm = 0x124
movl %ebx, %edi
movq %r14, %rsi
callq 0x8b20
incq %r15
movslq 0x2fdf04(%rip), %rax    # 0x32b400
addq $0x124, %r14            # imm = 0x124
cmpq %rax, %r15
jl 0x2d4e3
leaq 0x28ffc1(%rip), %rsi    # 0x2bd4d0
movl $0x4, %edx
movl %ebx, %edi
callq 0x8b20
cmpl $0x0, 0x28ffae(%rip)    # 0x2bd4d0
jle 0x2d588
leaq 0x2eb895(%rip), %r15    # 0x318dc0
leaq 0x2eb50e(%rip), %r14    # 0x318a40
xorl %r12d, %r12d
movl $0x1c, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x8b20
cmpl $0x2, 0x14(%r14)
jne 0x2d571
cmpl $-0x1, 0x18(%r14)
je 0x2d571
movq (%r15), %rax
movl 0xc(%rax), %edi
movl (%rax), %esi
movl 0x4(%rax), %edx
movl 0x10(%rax), %ecx
movl $0x8, %r8d
callq 0x1c1f1
movq (%r15), %rcx
movl %eax, 0x18(%rcx)
incq %r12
movslq 0x28ff55(%rip), %rax    # 0x2bd4d0
addq $0x8, %r15
addq $0x1c, %r14
cmpq %rax, %r12
jl 0x2d535
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq