// File: /workspace/github_c_makefile_star2_O0/beejjorgensen[P]conquest/conqve.c
// Function: invest
void invest(void)
{
    int newborn, starnum;
    struct stplanet *pplan;
    production_year = 0;
    point(33, 20);
    printw("* investment *  ");
    for (starnum = 1; starnum <= nstars; starnum++) {
        pplan = stars[starnum].first_planet;
        while (pplan != nil) {
            if (((pplan->esee_team) == player)
                && ((pplan->capacity) > 10)
                && ((pplan->esee_def) < 12))
                pplan->esee_def = (pplan->esee_def) + 1;
            if ((pplan->team) != none) {
                newborn = conq_round((pplan->inhabitants)
                                     * growth_rate[pplan->team] *
                                     (1 -
                                      ((pplan->inhabitants) /
                                       (pplan->capacity))));
                if (pplan->conquered)
                    newborn = newborn / 2;
                pplan->inhabitants = (pplan->inhabitants)
                    + newborn;
                pplan->iu = (pplan->iu) + newborn;
                if (pplan->team == ENEMY)
                    inv_enemy(pplan);
                else
                    inv_player(stars[starnum].x, stars[starnum].y, pplan);
            };
            pplan = pplan->next;
        };
    };
    battle();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x74e9(%rip), %rax      # 0x14798
movl $0x0, (%rax)
movl $0x21, %edi
movl $0x14, %esi
callq 0x69f0
leaq 0x217c(%rip), %rdi      # 0xf447
movb $0x0, %al
callq 0x2030
movl $0x1, -0x8(%rbp)
cmpl $0x15, -0x8(%rbp)
jg 0xd42e
movslq -0x8(%rbp), %rcx
leaq 0x71b2(%rip), %rax      # 0x144a0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xd41e
movq -0x10(%rbp), %rax
cmpl $0x1, 0x28(%rax)
jne 0xd337
movq -0x10(%rbp), %rax
cmpl $0xa, 0x4(%rax)
jle 0xd337
movq -0x10(%rbp), %rax
cmpl $0xc, 0x2c(%rax)
jge 0xd337
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x10(%rbp), %rax
cmpl $0x2, 0xc(%rax)
je 0xd40d
movq -0x10(%rbp), %rax
cvtsi2ssl 0x10(%rax), %xmm0
movq -0x10(%rbp), %rax
movslq 0xc(%rax), %rcx
leaq 0x7353(%rip), %rax      # 0x146b0
mulss (%rax,%rcx,4), %xmm0
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x10(%rbp), %rcx
cltd
idivl 0x4(%rcx)
movl %eax, %ecx
movl $0x1, %eax
subl %ecx, %eax
cvtsi2ss %eax, %xmm1
mulss %xmm1, %xmm0
callq 0x6ab0
movl %eax, -0x4(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0xd3a2
movl -0x4(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x4(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
addl -0x4(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movl 0x14(%rax), %ecx
addl -0x4(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0xd3d9
movq -0x10(%rbp), %rdi
callq 0xc4a0
jmp 0xd40b
movslq -0x8(%rbp), %rcx
leaq 0x70bc(%rip), %rax      # 0x144a0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edi
movslq -0x8(%rbp), %rcx
leaq 0x70a8(%rip), %rax      # 0x144a0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %esi
movq -0x10(%rbp), %rdx
callq 0xc980
jmp 0xd40d
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0xd2fd
jmp 0xd420
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xd2d9
callq 0x45f0
addq $0x10, %rsp
popq %rbp
retq