// File: /workspace/github_c_makefile_star2_O3/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 0x2503
movl $0x7e000, %ecx          # imm = 0x7E000
btl %eax, %ecx
jae 0x243e
leaq 0xacf7(%rip), %rax      # 0xd118
movq (%rax), %rdi
movq 0x98(%r14), %rdx
leaq 0x51fa(%rip), %rsi      # 0x762c
xorl %eax, %eax
callq 0x1190
addl $-0x4, (%rbx)
jmp 0x246a
movl $0x48a, %ecx            # imm = 0x48A
btl %eax, %ecx
jae 0x2475
leaq 0xacc9(%rip), %rax      # 0xd118
movq (%rax), %rdi
movq 0x98(%r14), %rdx
leaq 0x51cc(%rip), %rsi      # 0x762c
xorl %eax, %eax
callq 0x1190
addl $-0x2, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x13, %eax
jne 0x2503
leaq 0xac93(%rip), %rax      # 0xd118
movq (%rax), %rbx
callq 0x11c0
cmpl $0x7ffffffd, %eax       # imm = 0x7FFFFFFD
jg 0x2488
cltq
imulq $0x2c000001, %rax, %rcx # imm = 0x2C000001
movq %rcx, %rax
shrq $0x3f, %rax
sarq $0x39, %rcx
addl %eax, %ecx
leaq 0xac8f(%rip), %rax      # 0xd140
movq (%rax), %rax
movq 0x28(%rax), %rax
cmpl 0x20(%rax), %ecx
jle 0x2566
leaq 0xac70(%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 0x5915(%rip), %rsi      # 0x7e0a
movq %rax, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x1180
jmp 0x256d
callq 0x11c0
cmpl $0x7ffffffd, %eax       # imm = 0x7FFFFFFD
jg 0x2503
cltq
imulq $0x2c000001, %rax, %rax # imm = 0x2C000001
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x39, %rax
addl %ecx, %eax
cmpl 0x20(%r14), %eax
jle 0x257c
movl 0x14(%r14), %r15d
subl 0x10(%rbx), %r15d
leaq 0xabde(%rip), %rax      # 0xd118
movq (%rax), %rdi
movq 0x88(%rbx), %rdx
leaq 0x50e1(%rip), %rsi      # 0x762c
xorl %eax, %eax
callq 0x1190
movl (%r14), %eax
addl %r15d, %eax
addl $-0x4, %eax
movl %eax, (%r14)
incl 0x8(%rbx)
jmp 0x246a
leaq 0x5939(%rip), %r14      # 0x7ea6
leaq 0x50b8(%rip), %rsi      # 0x762c
movq %rbx, %rdi
movq %r14, %rdx
jmp 0x2594
leaq 0xab95(%rip), %rax      # 0xd118
movq (%rax), %rdi
movq 0x90(%rbx), %rdx
leaq 0x5098(%rip), %rsi      # 0x762c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1190