// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x2f9cb0(%rip), %rsi    # 0x324424
pushq $0x4
popq %rdx
callq 0x8b20
leaq 0x2f9cad(%rip), %r14    # 0x324430
xorl %r12d, %r12d
pushq $0x18
popq %r15
movslq 0x2f9c93(%rip), %rax    # 0x324424
cmpq %rax, %r12
jge 0x2a7ac
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x8b20
incq %r12
addq $0x18, %r14
jmp 0x2a78a
leaq 0x2fa07d(%rip), %rsi    # 0x324830
pushq $0x2
popq %rdx
movl %ebx, %edi
callq 0x8b20
leaq 0x2fa07c(%rip), %r14    # 0x324840
xorl %r12d, %r12d
pushq $0x10
popq %r15
movswq 0x2fa05d(%rip), %rax    # 0x324830
cmpq %rax, %r12
jge 0x2a7ee
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x8b20
incq %r12
addq $0x10, %r14
jmp 0x2a7cb
leaq 0x2fa35b(%rip), %rsi    # 0x324b50
pushq $0x10
popq %rdx
movl %ebx, %edi
callq 0x8b20
leaq 0x28bcee(%rip), %rsi    # 0x2b64f4
pushq $0x4
popq %rdx
movl %ebx, %edi
callq 0x8b20
leaq 0x28fce9(%rip), %r14    # 0x2ba500
xorl %r12d, %r12d
pushq $0x3c
popq %r15
movslq 0x28bccf(%rip), %rax    # 0x2b64f4
cmpq %rax, %r12
jge 0x2a840
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x8b20
incq %r12
addq $0x3c, %r14
jmp 0x2a81e
leaq 0x28bcb9(%rip), %rsi    # 0x2b6500
movl $0x4000, %edx           # imm = 0x4000
movl %ebx, %edi
callq 0x8b20
leaq 0x2edbb6(%rip), %rsi    # 0x318410
pushq $0x4
popq %rdx
movl %ebx, %edi
callq 0x8b20
leaq 0x2dbc95(%rip), %r14    # 0x306500
xorl %r12d, %r12d
pushq $0x64
popq %r15
movslq 0x2edb97(%rip), %rax    # 0x318410
cmpq %rax, %r12
jge 0x2a894
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x8b20
incq %r12
addq $0x64, %r14
jmp 0x2a872
leaq 0x2e10c5(%rip), %rsi    # 0x30b960
pushq $0x4
popq %rdx
movl %ebx, %edi
callq 0x8b20
leaq 0x2e50c4(%rip), %r14    # 0x30f970
xorl %r12d, %r12d
pushq $0x1c
popq %r15
movslq 0x2e10a6(%rip), %rax    # 0x30b960
cmpq %rax, %r12
jge 0x2a8d5
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x8b20
incq %r12
addq $0x1c, %r14
jmp 0x2a8b3
leaq 0x2e1094(%rip), %rsi    # 0x30b970
movl $0x4000, %edx           # imm = 0x4000
movl %ebx, %edi
callq 0x8b20
leaq 0x2e75f1(%rip), %rsi    # 0x311ee0
pushq $0x4
popq %rdx
movl %ebx, %edi
callq 0x8b20
leaq 0x2e75f0(%rip), %r14    # 0x311ef0
xorl %r15d, %r15d
movslq 0x2e75d6(%rip), %rax    # 0x311ee0
cmpq %rax, %r15
jge 0x2a92a
movl $0xa14, %edx            # imm = 0xA14
movl %ebx, %edi
movq %r14, %rsi
callq 0x8b20
incq %r15
addq $0xa14, %r14            # imm = 0xA14
jmp 0x2a903
callq 0x2a3b0
leaq 0x2edaea(%rip), %rsi    # 0x318420
movl $0x8000, %edx           # imm = 0x8000
movl %ebx, %edi
callq 0x8b20
leaq 0x2f9ad7(%rip), %rsi    # 0x324420
pushq $0x4
popq %rdx
movl %ebx, %edi
callq 0x8b20
leaq 0x2e53a6(%rip), %r14    # 0x30fd00
xorl %r15d, %r15d
movslq 0x2f9abc(%rip), %rax    # 0x324420
cmpq %rax, %r15
jge 0x2a984
movl $0x124, %edx            # imm = 0x124
movl %ebx, %edi
movq %r14, %rsi
callq 0x8b20
incq %r15
addq $0x124, %r14            # imm = 0x124
jmp 0x2a95d
leaq 0x28bb65(%rip), %rsi    # 0x2b64f0
pushq $0x4
popq %rdx
movl %ebx, %edi
callq 0x8b20
leaq 0x2e7444(%rip), %r12    # 0x311de0
leaq 0x2e70bd(%rip), %r14    # 0x311a60
xorl %r13d, %r13d
pushq $0x1c
popq %r15
pushq $0x8
popq %rbp
movslq 0x28bb3c(%rip), %rax    # 0x2b64f0
cmpq %rax, %r13
jge 0x2a9ff
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x8b20
cmpl $0x2, 0x14(%r14)
jne 0x2a9f2
cmpl $-0x1, 0x18(%r14)
je 0x2a9f2
movq (%r12), %rax
movl 0xc(%rax), %edi
movl (%rax), %esi
movl 0x4(%rax), %edx
movl 0x10(%rax), %ecx
movl %ebp, %r8d
callq 0x1ab2a
movq (%r12), %rcx
movl %eax, 0x18(%rcx)
incq %r13
addq $0x8, %r12
addq $0x1c, %r14
jmp 0x2a9ad
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq