// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x18(%rbp)
subl $0x1, %eax
je 0x2b39
jmp 0x2b01
movl -0x18(%rbp), %eax
subl $0x3, %eax
je 0x2b39
jmp 0x2b0b
movl -0x18(%rbp), %eax
subl $0x7, %eax
je 0x2b39
jmp 0x2b15
movl -0x18(%rbp), %eax
subl $0xa, %eax
je 0x2b39
jmp 0x2b1f
movl -0x18(%rbp), %eax
addl $-0xd, %eax
subl $0x6, %eax
jb 0x2b6c
jmp 0x2b2c
movl -0x18(%rbp), %eax
subl $0x13, %eax
je 0x2b9f
jmp 0x2bcc
leaq 0xe5e8(%rip), %rax      # 0x11128
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rdx
leaq 0x7a9d(%rip), %rsi      # 0xa5f2
movb $0x0, %al
callq 0x11a0
movq -0x8(%rbp), %rax
movl (%rax), %ecx
subl $0x2, %ecx
movl %ecx, (%rax)
jmp 0x2c57
leaq 0xe5b5(%rip), %rax      # 0x11128
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rdx
leaq 0x7a6a(%rip), %rsi      # 0xa5f2
movb $0x0, %al
callq 0x11a0
movq -0x8(%rbp), %rax
movl (%rax), %ecx
subl $0x4, %ecx
movl %ecx, (%rax)
jmp 0x2c57
leaq 0xe582(%rip), %rax      # 0x11128
movq (%rax), %rax
movq %rax, -0x20(%rbp)
callq 0x31f0
movq -0x20(%rbp), %rdi
movq %rax, %rdx
leaq 0x7a32(%rip), %rsi      # 0xa5f2
movb $0x0, %al
callq 0x11a0
jmp 0x2c57
movl $0xa, %edi
callq 0x20e0
movq -0x10(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jle 0x2c32
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
addl $0x4, %eax
movq -0x10(%rbp), %rcx
subl 0x14(%rcx), %eax
movl %eax, -0x14(%rbp)
leaq 0xe52e(%rip), %rax      # 0x11128
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rdx
leaq 0x79e3(%rip), %rsi      # 0xa5f2
movb $0x0, %al
callq 0x11a0
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rax
movl (%rax), %ecx
subl %edx, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0x2c55
leaq 0xe4ef(%rip), %rax      # 0x11128
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rdx
leaq 0x79a4(%rip), %rsi      # 0xa5f2
movb $0x0, %al
callq 0x11a0
jmp 0x2c57
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)