// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekgun.c
// Function: killscore
void
killscore(short hs, short snum, char guntype)
{
     int       ext=sprptr[hs]->extra;
     short     score;

     if( !validplayer(snum) ) {
          return;
     }
     if( !validext(ext) ) {
          return;
     }

     if( isanandroid(hs) ) {
          score=200;
     }
     else if( isahologram(hs) ) {
          score=100;
     }
     else {
          switch( sprXTptr[ext]->class ) {
          case CLASS_NULL:
               return;
          case CLASS_FCIAGENT:
               score=-500;
               break;
          case CLASS_CIVILLIAN:
               score=-500;
               break;
          case CLASS_SPIDERDROID:
               score=50;
               break;
          case CLASS_COP:
               score=-500;
               break;
          case CLASS_MECHCOP:
               score=-50;
               break;
          case CLASS_TEKBURNOUT:
               score=100;
               break;
          case CLASS_TEKGOON:
               score=200;
               break;
          case CLASS_ASSASSINDROID:
               score=300;
               break;
          case CLASS_SECURITYDROID:
               score=100;
               break;
          case CLASS_TEKBOSS:
               score=300;
               break;
          case CLASS_TEKLORD:
               score=500;
               break;
          }
          switch( guntype ) {
          case 0:
          case 1:
               if( score < 0 ) {
                    score=0;
               }
               else {
                    score+=(score<<1);
               }
               break;
          }
     }

     if( option[4] != 0 ) {
          score>>=4;
     }
     changescore(snum, score);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %dl, %al
movw %si, %cx
movw %di, %dx
movw %dx, -0x2(%rbp)
movw %cx, -0x4(%rbp)
movb %al, -0x5(%rbp)
movswq -0x2(%rbp), %rcx
leaq 0x168099(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswl 0x2a(%rax), %eax
movl %eax, -0xc(%rbp)
movswl -0x4(%rbp), %edi
callq 0x11c50
cmpl $0x0, %eax
jne 0x12165
jmp 0x12291
movl -0xc(%rbp), %edi
callq 0x2ae90
cmpl $0x0, %eax
jne 0x12177
jmp 0x12291
movswl -0x2(%rbp), %edi
callq 0x2ec80
cmpl $0x0, %eax
je 0x12190
movw $0xc8, -0xe(%rbp)
jmp 0x12266
movswl -0x2(%rbp), %edi
callq 0x2ed00
cmpl $0x0, %eax
je 0x121a9
movw $0x64, -0xe(%rbp)
jmp 0x12264
movslq -0xc(%rbp), %rcx
leaq 0x21002c(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movzbl (%rax), %eax
movq %rax, -0x18(%rbp)
subq $0xb, %rax
ja 0x12234
movq -0x18(%rbp), %rax
leaq 0xc7130(%rip), %rcx     # 0xd9300
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x12291
movw $0xfe0c, -0xe(%rbp)     # imm = 0xFE0C
jmp 0x12234
movw $0xfe0c, -0xe(%rbp)     # imm = 0xFE0C
jmp 0x12234
movw $0x32, -0xe(%rbp)
jmp 0x12234
movw $0xfe0c, -0xe(%rbp)     # imm = 0xFE0C
jmp 0x12234
movw $0xffce, -0xe(%rbp)     # imm = 0xFFCE
jmp 0x12234
movw $0x64, -0xe(%rbp)
jmp 0x12234
movw $0xc8, -0xe(%rbp)
jmp 0x12234
movw $0x12c, -0xe(%rbp)      # imm = 0x12C
jmp 0x12234
movw $0x64, -0xe(%rbp)
jmp 0x12234
movw $0x12c, -0xe(%rbp)      # imm = 0x12C
jmp 0x12234
movw $0x1f4, -0xe(%rbp)      # imm = 0x1F4
movsbl -0x5(%rbp), %eax
subl $0x1, %eax
ja 0x12262
jmp 0x1223f
movswl -0xe(%rbp), %eax
cmpl $0x0, %eax
jge 0x12250
movw $0x0, -0xe(%rbp)
jmp 0x12260
movswl -0xe(%rbp), %ecx
shll %ecx
movswl -0xe(%rbp), %eax
addl %ecx, %eax
movw %ax, -0xe(%rbp)
jmp 0x12262
jmp 0x12264
jmp 0x12266
leaq 0x107cab(%rip), %rax    # 0x119f18
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
je 0x12281
movswl -0xe(%rbp), %eax
sarl $0x4, %eax
movw %ax, -0xe(%rbp)
movw -0x4(%rbp), %ax
movswl %ax, %edi
movswl -0xe(%rbp), %esi
callq 0x9f70
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)