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

     clearmidstatbar16();

     if( (recordXT < 0) || (recordXT > MAXSPRITES) ) {
          sprintf(what, "NO current valid copy EXT to copy !");
          printmessage16(what);
          return;
     }

     j=sprite[sn].extra;

     if( j < 0 ) {
          sprintf(what, "Mapping EXT for sprite %d...", sn);
          printmessage16(what);
          j=JS_FirstFreeExt();
          if( j == -1 ) {
               printmessage16("ERROR! Not able to map to an extension.");
               return;
          }
          printmessage16("Extension Mapped.");
          sprite[sn].extra=j;
          JS_InitExtension(sn, j);
          JS_LockExt(j);
          JS_ShowSpriteExts(sn);
     }
     else {
          sprintf(tempbuf, "Overwrite existing EXT for sprite %d ?  1=YES 0=NO ", sn);
          ans=getnumber16(tempbuf, 0, 2L, 0);
          if( ans != 1 ) {
               printmessage16("Not Copied...");
               return;
          }
     }

     memcpy(&spriteXT[j], &recXT, sizeof(struct spriteextension));

     sprintf(what, "Copying Ext %d to sprite %d...", recordXT, sn);
     printmessage16(what);

     JS_ShowSpriteExts(sn);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x4(%rbp)
callq 0x28000
movswl 0xc6241(%rip), %eax     # 0xcf6b8
cmpl $0x0, %eax
jl 0x948a
movswl 0xc6235(%rip), %eax     # 0xcf6b8
cmpl $0x4000, %eax           # imm = 0x4000
jle 0x94aa
leaq -0x40(%rbp), %rdi
leaq 0xa5d50(%rip), %rsi     # 0xaf1e5
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
callq 0x25760
jmp 0x95f8
movslq -0x4(%rbp), %rcx
leaq 0x2b035b(%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 0x955d
leaq -0x40(%rbp), %rdi
movl -0x4(%rbp), %edx
leaq 0xa5d2a(%rip), %rsi     # 0xaf209
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
callq 0x25760
callq 0x9600
movw %ax, -0x42(%rbp)
movswl -0x42(%rbp), %eax
cmpl $-0x1, %eax
jne 0x9512
leaq 0xa5d1e(%rip), %rdi     # 0xaf226
callq 0x25760
jmp 0x95f8
leaq 0xa5d35(%rip), %rdi     # 0xaf24e
callq 0x25760
movw -0x42(%rbp), %cx
movslq -0x4(%rbp), %rdx
leaq 0x2b02e3(%rip), %rax    # 0x2b9810
imulq $0x2c, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x2a(%rax)
movl -0x4(%rbp), %eax
movswl %ax, %edi
movswl -0x42(%rbp), %esi
callq 0x9660
movswl -0x42(%rbp), %edi
callq 0x9700
movl -0x4(%rbp), %eax
movswl %ax, %edi
callq 0x73b0
jmp 0x95a4
movl -0x4(%rbp), %edx
leaq 0xd88c9(%rip), %rdi     # 0xe1e30
leaq 0xa5cf2(%rip), %rsi     # 0xaf260
movb $0x0, %al
callq 0x6a30
leaq 0xd88b4(%rip), %rdi     # 0xe1e30
xorl %ecx, %ecx
movl $0x2, %edx
movl %ecx, %esi
callq 0x28760
cwtl
movl %eax, -0x48(%rbp)
cmpl $0x1, -0x48(%rbp)
je 0x95a2
leaq 0xa5cf9(%rip), %rdi     # 0xaf294
callq 0x25760
jmp 0x95f8
jmp 0x95a4
movswq -0x42(%rbp), %rax
leaq 0xd89b0(%rip), %rdi     # 0xe1f60
imulq $0x22, %rax, %rax
addq %rax, %rdi
leaq 0xd8972(%rip), %rsi     # 0xe1f30
movl $0x22, %edx
callq 0x60c0
leaq -0x40(%rbp), %rdi
movswl 0xc60e5(%rip), %edx     # 0xcf6b8
movl -0x4(%rbp), %ecx
leaq 0xa5cc5(%rip), %rsi     # 0xaf2a2
movb $0x0, %al
callq 0x6a30
leaq -0x40(%rbp), %rdi
callq 0x25760
movl -0x4(%rbp), %eax
movswl %ax, %edi
callq 0x73b0
addq $0x50, %rsp
popq %rbp
retq
nop