// File: /workspace/github_cpp_makefile_star2_O2/arisKoutsou[P]oopproj/./src/game_utils.cpp
// Function: regenerateStats()
void regenerateStats(void) {
  for (size_t i = 0U; i != heroes.size(); ++i) {
    if (heroes[i]->getHealthPower() != 0) {
      int health = heroes[i]->getHealthPower();
      int mana = heroes[i]->getMagicPower();
      heroes[i]->setHealthPower(health + health*0.01);
      if (heroes[i]->getHealthPower() > heroes[i]->getMaxHealthPower()) {
	heroes[i]->setHealthPower(heroes[i]->getMaxHealthPower());
      }
      if (mana == 0) {
	heroes[i]->setMagicPower(100);
      } else {
	heroes[i]->setMagicPower(mana + mana*0.1);
	if (heroes[i]->getMagicPower() > heroes[i]->getMaxMagicPower()) {
	  heroes[i]->setMagicPower(heroes[i]->getMaxMagicPower());
	}
      }
    }
  }
  list<Monster*> :: const_iterator it = monsters.begin();
  for ( ; it != monsters.end(); ++it) {
    int health = (*it)->getHealthPower();
    (*it)->setHealthPower(health + health*0.01);
    if ((*it)->getHealthPower() > (*it)->getMaxHealthPower()) {
      (*it)->setHealthPower((*it)->getMaxHealthPower());
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %r15d, %r15d
pushq $0x64
popq %rbx
movq 0x1914b(%rip), %rcx     # 0x21288
movq 0x1913c(%rip), %rax     # 0x21280
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r15
je 0x8275
movq (%rax,%r15,8), %rdi
callq 0x12a58
testl %eax, %eax
je 0x826d
movq 0x19114(%rip), %rax     # 0x21280
movq (%rax,%r15,8), %rdi
callq 0x12a58
movl %eax, %r14d
movq 0x19101(%rip), %rax     # 0x21280
movq (%rax,%r15,8), %rdi
callq 0xf032
movl %eax, %ebp
movq 0x190ef(%rip), %rax     # 0x21280
movq (%rax,%r15,8), %rdi
cvtsi2sd %r14d, %xmm0
movapd %xmm0, %xmm1
mulsd 0xd282(%rip), %xmm1     # 0x15428
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %esi
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x190c5(%rip), %rax     # 0x21280
movq (%rax,%r15,8), %rdi
callq 0x12a58
movl %eax, %r14d
movq 0x190b2(%rip), %rax     # 0x21280
movq (%rax,%r15,8), %rdi
callq 0x12a5c
cmpl %eax, %r14d
jle 0x81fa
movq 0x1909d(%rip), %rax     # 0x21280
movq (%rax,%r15,8), %r14
movq %r14, %rdi
callq 0x12a5c
movq (%r14), %rcx
movq %r14, %rdi
movl %eax, %esi
callq *0x18(%rcx)
movq 0x1907f(%rip), %rax     # 0x21280
movq (%rax,%r15,8), %rdi
testl %ebp, %ebp
je 0x8266
cvtsi2sd %ebp, %xmm0
movapd %xmm0, %xmm1
mulsd 0xd1e7(%rip), %xmm1     # 0x15400
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %esi
callq 0xf0c8
movq 0x19053(%rip), %rax     # 0x21280
movq (%rax,%r15,8), %rdi
callq 0xf032
movl %eax, %ebp
movq 0x19041(%rip), %rax     # 0x21280
movq (%rax,%r15,8), %rdi
callq 0xf04a
cmpl %eax, %ebp
jle 0x826d
movq 0x1902d(%rip), %rax     # 0x21280
movq (%rax,%r15,8), %r14
movq %r14, %rdi
callq 0xf04a
movq %r14, %rdi
movl %eax, %esi
jmp 0x8268
movl %ebx, %esi
callq 0xf0c8
incq %r15
jmp 0x8136
leaq 0x19094(%rip), %r14     # 0x21310
movq %r14, %r15
movq (%r15), %r15
cmpq %r14, %r15
je 0x82e3
movq 0x10(%r15), %rdi
callq 0x12a58
movq 0x10(%r15), %rdi
cvtsi2sd %eax, %xmm0
movapd %xmm0, %xmm1
mulsd 0xd184(%rip), %xmm1     # 0x15428
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %esi
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x10(%r15), %rdi
callq 0x12a58
movl %eax, %ebx
movq 0x10(%r15), %rdi
callq 0x12a5c
cmpl %eax, %ebx
jle 0x827f
movq 0x10(%r15), %rbx
movq %rbx, %rdi
callq 0x12a5c
movq (%rbx), %rcx
movq %rbx, %rdi
movl %eax, %esi
callq *0x18(%rcx)
jmp 0x827f
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq