// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/bstub.c
// Function: checkextras
void checkextras(void)
{
     int       i,j,ext;
     FILE      *fp;

     fp=fopen("exts", "wt");
     if( fp == NULL ) {
          return;
     }

     fprintf(fp,"\n\t SPR\t\t EXT\n\n");
     for( i=0; i<MAXSPRITES; i++ ) {
          if( sprite[i].extra != -1 ) {
               fprintf(fp,"\t%4d\t\t%4d\n", i,sprite[i].extra);
          }
     }

     fprintf(fp, "\n");
     // check for maps to unlocked XT
     for( i=0; i<MAXSPRITES; i++ ) {
          ext=sprite[i].extra;
          if( ext != -1 ) {
               if( spriteXT[ext].lock == 0x00 ) {
                    sprite[i].extra=-1;
                    buildprintf("bad extra for %d\n", i);
                    fprintf(fp, "Sprite %d at %d,%d mapped to unlocked XT %4d\n", i,sprite[i].x,sprite[i].y,ext);
               }
          }
     }

     fprintf(fp, "\n");
     // check for locked XT with no mapping
     for( i=0; i<MAXSPRITES; i++ ) {
          if( spriteXT[i].lock == 0xFF ) {
               for( j=0; j<MAXSPRITES; j++ ) {
                    if( sprite[j].extra == i ) {
                         break;
                    }
               }
               if( j == MAXSPRITES ) {
                    spriteXT[i].lock=0x00;
                    buildprintf("extension %d had no map\n", i);
                    fprintf(fp, "No mapping for locked XT %4d\n", i);
               }
          }
     }

     fprintf(fp, "\n");
     // check for non-unique mapping
     for( i=0; i<MAXSPRITES; i++ ) {
          ext=sprite[i].extra;
          if( ext != -1 ) {
               for( j=0; j<MAXSPRITES; j++ ) {
                    if( (j != i) && (sprite[j].extra == ext) ) {
                         buildprintf("non unique map for %d\n",i);
                         fprintf(fp, "Non unique mapping for %4d at %d,%d\n", i,sprite[i].x,sprite[i].y);
                         break;
                    }
               }
          }
     }

     fclose(fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0xa848c(%rip), %rdi     # 0xaf42b
leaq 0xa848a(%rip), %rsi     # 0xaf430
callq 0x6c10
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x6fbb
jmp 0x72e7
movq -0x18(%rbp), %rdi
leaq 0xa846d(%rip), %rsi     # 0xaf433
movb $0x0, %al
callq 0x61e0
movl $0x0, -0x4(%rbp)
cmpl $0x4000, -0x4(%rbp)     # imm = 0x4000
jge 0x7030
movslq -0x4(%rbp), %rcx
leaq 0x2b2828(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movswl 0x2a(%rax), %eax
cmpl $-0x1, %eax
je 0x7023
movq -0x18(%rbp), %rdi
movl -0x4(%rbp), %edx
movslq -0x4(%rbp), %rcx
leaq 0x2b2806(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movswl 0x2a(%rax), %ecx
leaq 0xa8426(%rip), %rsi     # 0xaf442
movb $0x0, %al
callq 0x61e0
jmp 0x7025
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x6fd4
movq -0x18(%rbp), %rdi
leaq 0xabec1(%rip), %rsi     # 0xb2efc
movb $0x0, %al
callq 0x61e0
movl $0x0, -0x4(%rbp)
cmpl $0x4000, -0x4(%rbp)     # imm = 0x4000
jge 0x7112
movslq -0x4(%rbp), %rcx
leaq 0x2b27af(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movswl 0x2a(%rax), %eax
movl %eax, -0xc(%rbp)
cmpl $-0x1, -0xc(%rbp)
je 0x7102
movslq -0xc(%rbp), %rcx
leaq 0xdaedc(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movzbl 0x1e(%rax), %eax
cmpl $0x0, %eax
jne 0x7100
movslq -0x4(%rbp), %rcx
leaq 0x2b2771(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw $0xffff, 0x2a(%rax)     # imm = 0xFFFF
movl -0x4(%rbp), %esi
leaq 0xa8397(%rip), %rdi     # 0xaf44d
movb $0x0, %al
callq 0x37c90
movq -0x18(%rbp), %rdi
movl -0x4(%rbp), %edx
movslq -0x4(%rbp), %rcx
leaq 0x2b2741(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movslq -0x4(%rbp), %rsi
leaq 0x2b272d(%rip), %rax    # 0x2b9810
imulq $0x2c, %rsi, %rsi
addq %rsi, %rax
movl 0x4(%rax), %r8d
movl -0xc(%rbp), %r9d
leaq 0xa8366(%rip), %rsi     # 0xaf45f
movb $0x0, %al
callq 0x61e0
jmp 0x7102
jmp 0x7104
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x7049
movq -0x18(%rbp), %rdi
leaq 0xabddf(%rip), %rsi     # 0xb2efc
movb $0x0, %al
callq 0x61e0
movl $0x0, -0x4(%rbp)
cmpl $0x4000, -0x4(%rbp)     # imm = 0x4000
jge 0x71ea
movslq -0x4(%rbp), %rcx
leaq 0xdae1d(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movzbl 0x1e(%rax), %eax
cmpl $0xff, %eax
jne 0x71da
movl $0x0, -0x8(%rbp)
cmpl $0x4000, -0x8(%rbp)     # imm = 0x4000
jge 0x7193
movslq -0x8(%rbp), %rcx
leaq 0x2b269c(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movswl 0x2a(%rax), %eax
cmpl -0x4(%rbp), %eax
jne 0x7186
jmp 0x7193
jmp 0x7188
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x7160
cmpl $0x4000, -0x8(%rbp)     # imm = 0x4000
jne 0x71d8
movslq -0x4(%rbp), %rcx
leaq 0xdadb9(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x1e(%rax)
movl -0x4(%rbp), %esi
leaq 0xa82d1(%rip), %rdi     # 0xaf48d
movb $0x0, %al
callq 0x37c90
movq -0x18(%rbp), %rdi
movl -0x4(%rbp), %edx
leaq 0xa82d5(%rip), %rsi     # 0xaf4a6
movb $0x0, %al
callq 0x61e0
jmp 0x71da
jmp 0x71dc
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x712b
movq -0x18(%rbp), %rdi
leaq 0xabd07(%rip), %rsi     # 0xb2efc
movb $0x0, %al
callq 0x61e0
movl $0x0, -0x4(%rbp)
cmpl $0x4000, -0x4(%rbp)     # imm = 0x4000
jge 0x72de
movslq -0x4(%rbp), %rcx
leaq 0x2b25f5(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movswl 0x2a(%rax), %eax
movl %eax, -0xc(%rbp)
cmpl $-0x1, -0xc(%rbp)
je 0x72ce
movl $0x0, -0x8(%rbp)
cmpl $0x4000, -0x8(%rbp)     # imm = 0x4000
jge 0x72cc
movl -0x8(%rbp), %eax
cmpl -0x4(%rbp), %eax
je 0x72bc
movslq -0x8(%rbp), %rcx
leaq 0x2b25b6(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movswl 0x2a(%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x72bc
movl -0x4(%rbp), %esi
leaq 0xa8250(%rip), %rdi     # 0xaf4c4
movb $0x0, %al
callq 0x37c90
movq -0x18(%rbp), %rdi
movl -0x4(%rbp), %edx
movslq -0x4(%rbp), %rcx
leaq 0x2b2583(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movslq -0x4(%rbp), %rsi
leaq 0x2b256f(%rip), %rax    # 0x2b9810
imulq $0x2c, %rsi, %rsi
addq %rsi, %rax
movl 0x4(%rax), %r8d
leaq 0xa8228(%rip), %rsi     # 0xaf4db
movb $0x0, %al
callq 0x61e0
jmp 0x72cc
jmp 0x72be
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x723a
jmp 0x72ce
jmp 0x72d0
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x7203
movq -0x18(%rbp), %rdi
callq 0x6420
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)