// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/bstub.c
// Function: JS_EditSpriteExts
int
JS_EditSpriteExts(short spritenum)
{
     char      what[50];
     short     j;

     spriteextmodified=1;

     clearmidstatbar16();

     j=sprite[spritenum].extra;

     if ( j < 0 ) {        // .extra is initialized to -1 in build.obj
          printmessage16("No Previous Extension.");
          j=JS_FirstFreeExt();
          if ( j == -1 ) {
               printmessage16("ERROR! Not able to map to an extension.");
               return(-1);
          }
          printmessage16("Extension Mapped.");
          sprite[spritenum].extra=j;
          JS_InitExtension(spritenum, j);
          JS_LockExt(j);
     }
     else {
          printmessage16("Editing Existing Extension.");
     }

     JS_ShowSpriteExts(spritenum);

     sprintf(what, "spriteextra[%d].class     = ", j);
     spriteXT[j].class=getnumber16(what, spriteXT[j].class, 12L, 0);

     sprintf(what, "spriteextra[%d].hitpoints = ", j);
     spriteXT[j].hitpoints=getnumber16(what, spriteXT[j].hitpoints, 256L, 0);

     sprintf(what, "spriteextra[%d].target    = ", j);
     spriteXT[j].target=getnumber16(what, spriteXT[j].target, 4096L, 0);
                                                   
     sprintf(what, "spriteextra[%d].fxmask    = ", j);
     spriteXT[j].fxmask=getnumber16(what, spriteXT[j].fxmask, 256L, 0);

     sprintf(what, "spriteextra[%d].aimask    = ", j);
     spriteXT[j].aimask=getnumber16(what, spriteXT[j].aimask, 256L, 0);

     sprintf(what, "spriteextra[%d].basestat  = ", j);
     spriteXT[j].basestat=getnumber16(what, spriteXT[j].basestat, 4096L, 0);

     sprintf(what, "spriteextra[%d].basepic   = ", j);
     spriteXT[j].basepic=getnumber16(what, spriteXT[j].basepic, 4096L, 0);

     sprintf(what, "spriteextra[%d].standpic = ", j);
     spriteXT[j].standpic=getnumber16(what, spriteXT[j].standpic, 4096L, 0);

     sprintf(what, "spriteextra[%d].walkpic = ", j);
     spriteXT[j].walkpic=getnumber16(what, spriteXT[j].walkpic, 4096L, 0);

     sprintf(what, "spriteextra[%d].runpic = ", j);
     spriteXT[j].runpic=getnumber16(what, spriteXT[j].runpic, 4096L, 0);

     sprintf(what, "spriteextra[%d].attackpic = ", j);
     spriteXT[j].attackpic=getnumber16(what, spriteXT[j].attackpic, 4096L, 0);

     sprintf(what, "spriteextra[%d].deathpic  = ", j);
     spriteXT[j].deathpic=getnumber16(what, spriteXT[j].deathpic, 4096L, 0);

     sprintf(what, "spriteextra[%d].painpic = ", j);
     spriteXT[j].painpic=getnumber16(what, spriteXT[j].painpic, 4096L, 0);

     sprintf(what, "spriteextra[%d].squatpic = ", j);
     spriteXT[j].squatpic=getnumber16(what, spriteXT[j].squatpic, 4096L, 0);

     sprintf(what, "spriteextra[%d].morphpic  = ", j);
     spriteXT[j].morphpic=getnumber16(what, spriteXT[j].morphpic, 4096L, 0);

     sprintf(what, "spriteextra[%d].specialpic  = ", j);
     spriteXT[j].specialpic=getnumber16(what, spriteXT[j].specialpic, 4096L, 0);

     sprintf(what, "spriteextra[%d].weapon  = ", j);
     spriteXT[j].weapon=getnumber16(what, spriteXT[j].weapon, 7L, 0);

     sprintf(what, "spriteextra[%d].ext2  = ", j);
     spriteXT[j].ext2=getnumber16(what, spriteXT[j].ext2, 4096L, 0);

     printmessage16("Sprite Extensions Saved.");

     JS_ShowSpriteExts(spritenum);

 return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movw %di, %ax
movw %ax, -0x6(%rbp)
movb $0x1, 0xd7b05(%rip)     # 0xe1e2b
callq 0x28000
movswq -0x6(%rbp), %rcx
leaq 0x2af4d9(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw 0x2a(%rax), %ax
movw %ax, -0x42(%rbp)
movswl -0x42(%rbp), %eax
cmpl $0x0, %eax
jge 0xa3c7
leaq 0xa5615(%rip), %rdi     # 0xaf96b
callq 0x25760
callq 0x9600
movw %ax, -0x42(%rbp)
movswl -0x42(%rbp), %eax
cmpl $-0x1, %eax
jne 0xa385
leaq 0xa4eb2(%rip), %rdi     # 0xaf226
callq 0x25760
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xaa17
leaq 0xa4ec2(%rip), %rdi     # 0xaf24e
callq 0x25760
movw -0x42(%rbp), %cx
movswq -0x6(%rbp), %rdx
leaq 0x2af46f(%rip), %rax    # 0x2b9810
imulq $0x2c, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x2a(%rax)
movw -0x6(%rbp), %ax
movswl %ax, %edi
movswl -0x42(%rbp), %esi
callq 0x9660
movswl -0x42(%rbp), %edi
callq 0x9700
jmp 0xa3d3
leaq 0xa55b4(%rip), %rdi     # 0xaf982
callq 0x25760
movswl -0x6(%rbp), %edi
callq 0x73b0
leaq -0x40(%rbp), %rdi
movswl -0x42(%rbp), %edx
leaq 0xa55b3(%rip), %rsi     # 0xaf99e
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
movswq -0x42(%rbp), %rcx
leaq 0xd7b5e(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movzbl (%rax), %eax
movl $0xc, %edx
xorl %ecx, %ecx
movswl %ax, %esi
callq 0x28760
movb %al, %cl
movswq -0x42(%rbp), %rdx
leaq 0xd7b37(%rip), %rax     # 0xe1f60
imulq $0x22, %rdx, %rdx
addq %rdx, %rax
movb %cl, (%rax)
leaq -0x40(%rbp), %rdi
movswl -0x42(%rbp), %edx
leaq 0xa557a(%rip), %rsi     # 0xaf9bb
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
movswq -0x42(%rbp), %rcx
leaq 0xd7b08(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movsbl 0x1(%rax), %eax
movl $0x100, %edx            # imm = 0x100
xorl %ecx, %ecx
movswl %ax, %esi
callq 0x28760
movb %al, %cl
movswq -0x42(%rbp), %rdx
leaq 0xd7ae0(%rip), %rax     # 0xe1f60
imulq $0x22, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x1(%rax)
leaq -0x40(%rbp), %rdi
movswl -0x42(%rbp), %edx
leaq 0xa553f(%rip), %rsi     # 0xaf9d8
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
movswq -0x42(%rbp), %rcx
leaq 0xd7ab0(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movl $0x1000, %edx           # imm = 0x1000
xorl %ecx, %ecx
movswl 0x2(%rax), %esi
callq 0x28760
movw %ax, %cx
movswq -0x42(%rbp), %rdx
leaq 0xd7a8a(%rip), %rax     # 0xe1f60
imulq $0x22, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x2(%rax)
leaq -0x40(%rbp), %rdi
movswl -0x42(%rbp), %edx
leaq 0xa5505(%rip), %rsi     # 0xaf9f5
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
movswq -0x42(%rbp), %rcx
leaq 0xd7a59(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movl $0x100, %edx            # imm = 0x100
xorl %ecx, %ecx
movswl 0x4(%rax), %esi
callq 0x28760
movw %ax, %cx
movswq -0x42(%rbp), %rdx
leaq 0xd7a33(%rip), %rax     # 0xe1f60
imulq $0x22, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x4(%rax)
leaq -0x40(%rbp), %rdi
movswl -0x42(%rbp), %edx
leaq 0xa54cb(%rip), %rsi     # 0xafa12
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
movswq -0x42(%rbp), %rcx
leaq 0xd7a02(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movl $0x100, %edx            # imm = 0x100
xorl %ecx, %ecx
movswl 0x6(%rax), %esi
callq 0x28760
movw %ax, %cx
movswq -0x42(%rbp), %rdx
leaq 0xd79dc(%rip), %rax     # 0xe1f60
imulq $0x22, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x6(%rax)
leaq -0x40(%rbp), %rdi
movswl -0x42(%rbp), %edx
leaq 0xa5491(%rip), %rsi     # 0xafa2f
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
movswq -0x42(%rbp), %rcx
leaq 0xd79ab(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movl $0x1000, %edx           # imm = 0x1000
xorl %ecx, %ecx
movswl 0x8(%rax), %esi
callq 0x28760
movw %ax, %cx
movswq -0x42(%rbp), %rdx
leaq 0xd7985(%rip), %rax     # 0xe1f60
imulq $0x22, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x8(%rax)
leaq -0x40(%rbp), %rdi
movswl -0x42(%rbp), %edx
leaq 0xa5457(%rip), %rsi     # 0xafa4c
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
movswq -0x42(%rbp), %rcx
leaq 0xd7954(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movl $0x1000, %edx           # imm = 0x1000
xorl %ecx, %ecx
movswl 0xa(%rax), %esi
callq 0x28760
movw %ax, %cx
movswq -0x42(%rbp), %rdx
leaq 0xd792e(%rip), %rax     # 0xe1f60
imulq $0x22, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0xa(%rax)
leaq -0x40(%rbp), %rdi
movswl -0x42(%rbp), %edx
leaq 0xa541d(%rip), %rsi     # 0xafa69
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
movswq -0x42(%rbp), %rcx
leaq 0xd78fd(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movl $0x1000, %edx           # imm = 0x1000
xorl %ecx, %ecx
movswl 0xc(%rax), %esi
callq 0x28760
movw %ax, %cx
movswq -0x42(%rbp), %rdx
leaq 0xd78d7(%rip), %rax     # 0xe1f60
imulq $0x22, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0xc(%rax)
leaq -0x40(%rbp), %rdi
movswl -0x42(%rbp), %edx
leaq 0xa53e2(%rip), %rsi     # 0xafa85
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
movswq -0x42(%rbp), %rcx
leaq 0xd78a6(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movl $0x1000, %edx           # imm = 0x1000
xorl %ecx, %ecx
movswl 0xe(%rax), %esi
callq 0x28760
movw %ax, %cx
movswq -0x42(%rbp), %rdx
leaq 0xd7880(%rip), %rax     # 0xe1f60
imulq $0x22, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0xe(%rax)
leaq -0x40(%rbp), %rdi
movswl -0x42(%rbp), %edx
leaq 0xa53a6(%rip), %rsi     # 0xafaa0
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
movswq -0x42(%rbp), %rcx
leaq 0xd784f(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movl $0x1000, %edx           # imm = 0x1000
xorl %ecx, %ecx
movswl 0x10(%rax), %esi
callq 0x28760
movw %ax, %cx
movswq -0x42(%rbp), %rdx
leaq 0xd7829(%rip), %rax     # 0xe1f60
imulq $0x22, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x10(%rax)
leaq -0x40(%rbp), %rdi
movswl -0x42(%rbp), %edx
leaq 0xa5369(%rip), %rsi     # 0xafaba
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
movswq -0x42(%rbp), %rcx
leaq 0xd77f8(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movl $0x1000, %edx           # imm = 0x1000
xorl %ecx, %ecx
movswl 0x12(%rax), %esi
callq 0x28760
movw %ax, %cx
movswq -0x42(%rbp), %rdx
leaq 0xd77d2(%rip), %rax     # 0xe1f60
imulq $0x22, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x12(%rax)
leaq -0x40(%rbp), %rdi
movswl -0x42(%rbp), %edx
leaq 0xa532f(%rip), %rsi     # 0xafad7
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
movswq -0x42(%rbp), %rcx
leaq 0xd77a1(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movl $0x1000, %edx           # imm = 0x1000
xorl %ecx, %ecx
movswl 0x14(%rax), %esi
callq 0x28760
movw %ax, %cx
movswq -0x42(%rbp), %rdx
leaq 0xd777b(%rip), %rax     # 0xe1f60
imulq $0x22, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x14(%rax)
leaq -0x40(%rbp), %rdi
movswl -0x42(%rbp), %edx
leaq 0xa52f5(%rip), %rsi     # 0xafaf4
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
movswq -0x42(%rbp), %rcx
leaq 0xd774a(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movl $0x1000, %edx           # imm = 0x1000
xorl %ecx, %ecx
movswl 0x16(%rax), %esi
callq 0x28760
movw %ax, %cx
movswq -0x42(%rbp), %rdx
leaq 0xd7724(%rip), %rax     # 0xe1f60
imulq $0x22, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x16(%rax)
leaq -0x40(%rbp), %rdi
movswl -0x42(%rbp), %edx
leaq 0xa52b9(%rip), %rsi     # 0xafb0f
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
movswq -0x42(%rbp), %rcx
leaq 0xd76f3(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movl $0x1000, %edx           # imm = 0x1000
xorl %ecx, %ecx
movswl 0x18(%rax), %esi
callq 0x28760
movw %ax, %cx
movswq -0x42(%rbp), %rdx
leaq 0xd76cd(%rip), %rax     # 0xe1f60
imulq $0x22, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x18(%rax)
leaq -0x40(%rbp), %rdi
movswl -0x42(%rbp), %edx
leaq 0xa527e(%rip), %rsi     # 0xafb2b
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
movswq -0x42(%rbp), %rcx
leaq 0xd769c(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movl $0x1000, %edx           # imm = 0x1000
xorl %ecx, %ecx
movswl 0x1a(%rax), %esi
callq 0x28760
movw %ax, %cx
movswq -0x42(%rbp), %rdx
leaq 0xd7676(%rip), %rax     # 0xe1f60
imulq $0x22, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x1a(%rax)
leaq -0x40(%rbp), %rdi
movswl -0x42(%rbp), %edx
leaq 0xa5244(%rip), %rsi     # 0xafb48
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
movswq -0x42(%rbp), %rcx
leaq 0xd7645(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movl $0x1000, %edx           # imm = 0x1000
xorl %ecx, %ecx
movswl 0x1c(%rax), %esi
callq 0x28760
movw %ax, %cx
movswq -0x42(%rbp), %rdx
leaq 0xd761f(%rip), %rax     # 0xe1f60
imulq $0x22, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x1c(%rax)
leaq -0x40(%rbp), %rdi
movswl -0x42(%rbp), %edx
leaq 0xa520c(%rip), %rsi     # 0xafb67
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
movswq -0x42(%rbp), %rcx
leaq 0xd75ee(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movzbl 0x1f(%rax), %eax
movl $0x7, %edx
xorl %ecx, %ecx
movswl %ax, %esi
callq 0x28760
movb %al, %cl
movswq -0x42(%rbp), %rdx
leaq 0xd75c6(%rip), %rax     # 0xe1f60
imulq $0x22, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x1f(%rax)
leaq -0x40(%rbp), %rdi
movswl -0x42(%rbp), %edx
leaq 0xa51cf(%rip), %rsi     # 0xafb82
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
movswq -0x42(%rbp), %rcx
leaq 0xd7596(%rip), %rax     # 0xe1f60
imulq $0x22, %rcx, %rcx
addq %rcx, %rax
movl $0x1000, %edx           # imm = 0x1000
xorl %ecx, %ecx
movswl 0x20(%rax), %esi
callq 0x28760
movw %ax, %cx
movswq -0x42(%rbp), %rdx
leaq 0xd7570(%rip), %rax     # 0xe1f60
imulq $0x22, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x20(%rax)
leaq 0xa5199(%rip), %rdi     # 0xafb9b
callq 0x25760
movswl -0x6(%rbp), %edi
callq 0x73b0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq