// File: /workspace/github_c_makefile_star2_O0/hyc[P]trek73c/trekx.c
// Function: Detonate
void Detonate(I)
int I;
{
  int Hits, I0, I1, J, K, M;

  I0 = Objects[I]->ObTyp;
  M = I0 % 10;
  I0 /= 10;
  I1 = I0;
  if (I0 == 0) {
    sprintf(scrstr,"++%s++ Destruction", Snams[I]);
    for (K = 0; K < Phasers; K++)
      Objects[I]->Fuel += Ships[I]->PChrg[K];
    for (K = 0; K < Tubes; K++)
      Objects[I]->Fuel += Ships[I]->Tengy[K];
    Vessels--;
  } else if (I0 == 1)
    sprintf(scrstr,"##%s's Engineering##", Snams[M]);
  else if (I0 == 2)
    sprintf(scrstr,"** %d **", I);
  else
    sprintf(scrstr,":: %d ::", I);
  SEndln();
  for (J = 0; J < ObjCount; J++) {
    if (Objects[J] != NULL) {
      if (Objects[J]->Trgt == I+1)
	Objects[J]->Trgt = 0;
    }
    if (J != I && Objects[J] != NULL) {
      Hits = AMHits(I, J);
      I0 = Objects[J]->ObTyp;
      M = I0 % 10;
      I0 /= 10;
      if (Hits > 0) {
	if (I0 == 0)
	  Damage(I, J, Hits, 1);
	else if (I0 == 1)
	  sprintf(scrstr,"Hit on %s's jettisoned Engineering", Snams[M]);
	else if (I0 == 2)
	  sprintf(scrstr,"Hit on probe %d", J);
	if (I0 > 0) {
	  Objects[J]->Tim_Del = 9999.0;
	  if (I0 < 3)
	    SEndln();
	}
      }
    }
  }
  free(Objects[I]);
  Objects[I] = NULL;
  if (I1 != 0)
    return;
  free(Ships[I]);
  Ships[I] = NULL;
  Redo = true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0xf3ea(%rip), %rax      # 0x155e0
movq (%rax,%rcx,8), %rax
movswl 0x4a(%rax), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %edx, -0x1c(%rbp)
movl -0xc(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x630b
movslq -0x4(%rbp), %rcx
leaq 0xf6e8(%rip), %rax      # 0x15920
movq (%rax,%rcx,8), %rdx
leaq 0xf25d(%rip), %rdi      # 0x154a0
leaq 0x9f07(%rip), %rsi      # 0x10151
movb $0x0, %al
callq 0x2190
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movzbl 0xef4e(%rip), %ecx      # 0x151b0
cmpl %ecx, %eax
jge 0x62a3
movslq -0x4(%rbp), %rcx
leaq 0xf70f(%rip), %rax      # 0x15980
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
movsd 0x20(%rax,%rcx,8), %xmm0
movslq -0x4(%rbp), %rcx
leaq 0xf356(%rip), %rax      # 0x155e0
movq (%rax,%rcx,8), %rax
addsd 0x20(%rax), %xmm0
movsd %xmm0, 0x20(%rax)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x6258
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movzbl 0xeefd(%rip), %ecx      # 0x151b1
cmpl %ecx, %eax
jge 0x62fb
movslq -0x4(%rbp), %rcx
leaq 0xf6bd(%rip), %rax      # 0x15980
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
movswl 0xc6(%rax,%rcx,2), %eax
cvtsi2sd %eax, %xmm0
movslq -0x4(%rbp), %rcx
leaq 0xf2fe(%rip), %rax      # 0x155e0
movq (%rax,%rcx,8), %rax
addsd 0x20(%rax), %xmm0
movsd %xmm0, 0x20(%rax)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x62aa
movb 0xf2d0(%rip), %al       # 0x155d1
addb $-0x1, %al
movb %al, 0xf2c8(%rip)       # 0x155d1
jmp 0x6373
cmpl $0x1, -0xc(%rbp)
jne 0x6337
movslq -0x1c(%rbp), %rcx
leaq 0xf604(%rip), %rax      # 0x15920
movq (%rax,%rcx,8), %rdx
leaq 0xf179(%rip), %rdi      # 0x154a0
leaq 0x9e36(%rip), %rsi      # 0x10164
movb $0x0, %al
callq 0x2190
jmp 0x6371
cmpl $0x2, -0xc(%rbp)
jne 0x6357
movl -0x4(%rbp), %edx
leaq 0xf159(%rip), %rdi      # 0x154a0
leaq 0x9e2b(%rip), %rsi      # 0x10179
movb $0x0, %al
callq 0x2190
jmp 0x636f
movl -0x4(%rbp), %edx
leaq 0xf13f(%rip), %rdi      # 0x154a0
leaq 0x9e1a(%rip), %rsi      # 0x10182
movb $0x0, %al
callq 0x2190
jmp 0x6371
jmp 0x6373
callq 0x4320
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movzbl 0xf249(%rip), %ecx      # 0x155d2
cmpl %ecx, %eax
jge 0x64ef
movslq -0x14(%rbp), %rcx
leaq 0xf244(%rip), %rax      # 0x155e0
cmpq $0x0, (%rax,%rcx,8)
je 0x63d7
movslq -0x14(%rbp), %rcx
leaq 0xf232(%rip), %rax      # 0x155e0
movq (%rax,%rcx,8), %rax
movswl 0x48(%rax), %eax
movl -0x4(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x63d5
movslq -0x14(%rbp), %rcx
leaq 0xf215(%rip), %rax      # 0x155e0
movq (%rax,%rcx,8), %rax
movw $0x0, 0x48(%rax)
jmp 0x63d7
movl -0x14(%rbp), %eax
cmpl -0x4(%rbp), %eax
je 0x64df
movslq -0x14(%rbp), %rcx
leaq 0xf1f2(%rip), %rax      # 0x155e0
cmpq $0x0, (%rax,%rcx,8)
je 0x64df
movl -0x4(%rbp), %edi
movl -0x14(%rbp), %esi
callq 0x6130
movl %eax, -0x8(%rbp)
movslq -0x14(%rbp), %rcx
leaq 0xf1ce(%rip), %rax      # 0x155e0
movq (%rax,%rcx,8), %rax
movswl 0x4a(%rax), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %edx, -0x1c(%rbp)
movl -0xc(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %eax, -0xc(%rbp)
cmpl $0x0, -0x8(%rbp)
jle 0x64dd
cmpl $0x0, -0xc(%rbp)
jne 0x645e
movl -0x4(%rbp), %edi
movl -0x14(%rbp), %esi
movl -0x8(%rbp), %edx
movl $0x1, %ecx
callq 0x4f80
jmp 0x64ac
cmpl $0x1, -0xc(%rbp)
jne 0x648a
movslq -0x1c(%rbp), %rcx
leaq 0xf4b1(%rip), %rax      # 0x15920
movq (%rax,%rcx,8), %rdx
leaq 0xf026(%rip), %rdi      # 0x154a0
leaq 0x9d0a(%rip), %rsi      # 0x1018b
movb $0x0, %al
callq 0x2190
jmp 0x64aa
cmpl $0x2, -0xc(%rbp)
jne 0x64a8
movl -0x14(%rbp), %edx
leaq 0xf006(%rip), %rdi      # 0x154a0
leaq 0x9c21(%rip), %rsi      # 0x100c2
movb $0x0, %al
callq 0x2190
jmp 0x64aa
jmp 0x64ac
cmpl $0x0, -0xc(%rbp)
jle 0x64db
movslq -0x14(%rbp), %rcx
leaq 0xf123(%rip), %rax      # 0x155e0
movq (%rax,%rcx,8), %rax
movsd 0x8bb7(%rip), %xmm0     # 0xf080
movsd %xmm0, 0x30(%rax)
cmpl $0x3, -0xc(%rbp)
jge 0x64d9
callq 0x4320
jmp 0x64db
jmp 0x64dd
jmp 0x64df
jmp 0x64e1
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x637f
movslq -0x4(%rbp), %rcx
leaq 0xf0e6(%rip), %rax      # 0x155e0
movq (%rax,%rcx,8), %rdi
callq 0x2120
movslq -0x4(%rbp), %rcx
leaq 0xf0d2(%rip), %rax      # 0x155e0
movq $0x0, (%rax,%rcx,8)
cmpl $0x0, -0x10(%rbp)
je 0x651e
jmp 0x654c
movslq -0x4(%rbp), %rcx
leaq 0xf457(%rip), %rax      # 0x15980
movq (%rax,%rcx,8), %rdi
callq 0x2120
movslq -0x4(%rbp), %rcx
leaq 0xf443(%rip), %rax      # 0x15980
movq $0x0, (%rax,%rcx,8)
movb $0x1, 0xf4d0(%rip)      # 0x15a1c
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)