// File: /workspace/github_c_makefile_star2_O1/return5[P]c_ish_one/./src/attack.c
// Function: powerAttack
static void powerAttack(Character *const attacker,Character *const defender) {
	switch(defender->type) {
		case 1://swordsman
		case 3://slinger
		case 7://four legged beast
		case 10://halfling
			//power attacks dont work against these types
			wprintw(prompt_win,"%s\n",defender->special_fail);
			attacker->health -= 2;
			break;
		case 13://enraged halfling
		case 14://enraged halfling
		case 15://enraged monster
		case 16://enraged monster
		case 17://enraged delmer
		case 18://enraged delmer
			//cant use special attack against enraged enemy
			wprintw(prompt_win,"%s\n",defender->special_fail);
			attacker->health -= 4;
			break;
		case 19: 
			wprintw(prompt_win,"%s\n",powerAttackBoss()); //power attack against boss
			break;
		default: //against any other enemy
			if(getRandInt(10) > defender->chance_to_dodge) {
				const int damage = (attacker->attack + 4) - defender->defense;
				wprintw(prompt_win,"%s\n",attacker->special_attack);
				defender->health -= damage;
				attacker->special_count += 1;
			}
			else{
				wprintw(prompt_win,"%s\n",attacker->special_attack_miss);
			}
			break;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x1c(%rsi), %eax
cmpl $0x13, %eax
ja 0x2523
movl $0x7e000, %ecx          # imm = 0x7E000
btl %eax, %ecx
jae 0x245e
leaq 0xacd7(%rip), %rax      # 0xd118
movq (%rax), %rdi
movq 0x98(%r14), %rdx
leaq 0x51aa(%rip), %rsi      # 0x75fc
xorl %eax, %eax
callq 0x1190
addl $-0x4, (%rbx)
jmp 0x248a
movl $0x48a, %ecx            # imm = 0x48A
btl %eax, %ecx
jae 0x2495
leaq 0xaca9(%rip), %rax      # 0xd118
movq (%rax), %rdi
movq 0x98(%r14), %rdx
leaq 0x517c(%rip), %rsi      # 0x75fc
xorl %eax, %eax
callq 0x1190
addl $-0x2, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x13, %eax
jne 0x2523
leaq 0xac73(%rip), %rax      # 0xd118
movq (%rax), %rbx
callq 0x11c0
cmpl $0x7ffffffd, %eax       # imm = 0x7FFFFFFD
jg 0x24a8
cltq
imulq $0x2c000001, %rax, %rcx # imm = 0x2C000001
movq %rcx, %rax
shrq $0x3f, %rax
sarq $0x39, %rcx
addl %eax, %ecx
leaq 0xac6f(%rip), %rax      # 0xd140
movq (%rax), %rax
movq 0x28(%rax), %rax
cmpl 0x20(%rax), %ecx
jle 0x2586
leaq 0xac50(%rip), %rcx      # 0xd138
movq (%rcx), %rcx
movq 0x28(%rcx), %rcx
movl 0x10(%rcx), %ebp
subl 0x14(%rax), %ebp
addl $0x4, %ebp
subl %ebp, (%rax)
movl $0x1, 0x8(%rcx)
movl $0xa0, %edi
callq 0x1160
movq %rax, %r14
leaq 0x58c5(%rip), %rsi      # 0x7dda
movq %rax, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x1180
jmp 0x258d
callq 0x11c0
cmpl $0x7ffffffd, %eax       # imm = 0x7FFFFFFD
jg 0x2523
cltq
imulq $0x2c000001, %rax, %rax # imm = 0x2C000001
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x39, %rax
addl %ecx, %eax
cmpl 0x20(%r14), %eax
jle 0x259c
movl 0x14(%r14), %r15d
subl 0x10(%rbx), %r15d
leaq 0xabbe(%rip), %rax      # 0xd118
movq (%rax), %rdi
movq 0x88(%rbx), %rdx
leaq 0x5091(%rip), %rsi      # 0x75fc
xorl %eax, %eax
callq 0x1190
movl (%r14), %eax
addl %r15d, %eax
addl $-0x4, %eax
movl %eax, (%r14)
incl 0x8(%rbx)
jmp 0x248a
leaq 0x58e9(%rip), %r14      # 0x7e76
leaq 0x5068(%rip), %rsi      # 0x75fc
movq %rbx, %rdi
movq %r14, %rdx
jmp 0x25b4
leaq 0xab75(%rip), %rax      # 0xd118
movq (%rax), %rdi
movq 0x90(%rbx), %rdx
leaq 0x5048(%rip), %rsi      # 0x75fc
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1190