// File: Thilotilo[P]DoaERando/General.cpp
// Function: DoaERando::General::ScaleSoldiersForZone(DoaERando::RandomNumberGenerator&)
void General::ScaleSoldiersForZone(RNG& rng)
{
    // Zone 9 is tiger leveling
    const std::vector<BYTE> MIN_SOLDIERS = {1,   10,  24, 33, 48, 53, 64, 82,  99,  128};
    const std::vector<BYTE> MAX_SOLDIERS = {121, 27,  32, 47, 61, 60, 79, 111, 121, 148};

    BYTE randomizedSoldiers = rng.GetRandomByte(MIN_SOLDIERS[zone], MAX_SOLDIERS[zone]);
    {
        if (allySoldierExponent & 0x80)
        {
            printf("Tiger detected, not modifying the first value.\n");
            printf("Changing %s's enemy soldier exponent from %d to %d\n", name, 
                                                                           enemySoldierExponent,
                                                                           randomizedSoldiers);
            enemySoldierExponent = randomizedSoldiers;
        }
        else
        {
            printf("Changing %s's soldier exponent from %d (and %d) to %d\n", name,
                                                                              enemySoldierExponent,
                                                                              allySoldierExponent,
                                                                              randomizedSoldiers);
            enemySoldierExponent = randomizedSoldiers;
            allySoldierExponent = randomizedSoldiers;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movb $0x1, -0x42(%rbp)
movb $0xa, -0x41(%rbp)
movb $0x18, -0x40(%rbp)
movb $0x21, -0x3f(%rbp)
movb $0x30, -0x3e(%rbp)
movb $0x35, -0x3d(%rbp)
movb $0x40, -0x3c(%rbp)
movb $0x52, -0x3b(%rbp)
movb $0x63, -0x3a(%rbp)
movb $-0x80, -0x39(%rbp)
leaq -0x42(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0xa, -0x30(%rbp)
leaq -0x43(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x404e70
movq -0x98(%rbp), %rcx
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq -0x28(%rbp), %rdi
callq 0x40fb50
jmp 0x414b70
leaq -0x43(%rbp), %rdi
callq 0x404fb0
movb $0x79, -0x8a(%rbp)
movb $0x1b, -0x89(%rbp)
movb $0x20, -0x88(%rbp)
movb $0x2f, -0x87(%rbp)
movb $0x3d, -0x86(%rbp)
movb $0x3c, -0x85(%rbp)
movb $0x4f, -0x84(%rbp)
movb $0x6f, -0x83(%rbp)
movb $0x79, -0x82(%rbp)
movb $-0x6c, -0x81(%rbp)
leaq -0x8a(%rbp), %rax
movq %rax, -0x80(%rbp)
movq $0xa, -0x78(%rbp)
leaq -0x8b(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x404e70
movq -0xa8(%rbp), %rcx
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
leaq -0x70(%rbp), %rdi
callq 0x40fb50
jmp 0x414bff
leaq -0x8b(%rbp), %rdi
callq 0x404fb0
movq -0xa0(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, -0xb8(%rbp)
movzbl 0x8(%rax), %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x415470
movq %rax, %rcx
movq -0xa0(%rbp), %rax
movzbl (%rcx), %ecx
movl %ecx, -0xb0(%rbp)
movzbl 0x8(%rax), %eax
movl %eax, %esi
leaq -0x70(%rbp), %rdi
callq 0x415470
movq -0xb8(%rbp), %rdi
movl -0xb0(%rbp), %esi
movzbl (%rax), %edx
callq 0x41db50
movb %al, -0xa9(%rbp)
jmp 0x414c6b
movq -0xa0(%rbp), %rax
movb -0xa9(%rbp), %cl
movb %cl, -0x8c(%rbp)
movzbl 0xc(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x414d29
leaq 0x186933(%rip), %rdi    # 0x59b5ca
xorl %eax, %eax
callq 0x4f06e0
jmp 0x414ca0
movq -0xa0(%rbp), %rax
movq %rax, %rsi
addq $0xf, %rsi
movzbl 0xb(%rax), %edx
movzbl -0x8c(%rbp), %ecx
leaq 0x18693a(%rip), %rdi    # 0x59b5fa
xorl %eax, %eax
callq 0x4f06e0
jmp 0x414cc9
movq -0xa0(%rbp), %rax
movb -0x8c(%rbp), %cl
movb %cl, 0xb(%rax)
jmp 0x414d70
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x43(%rbp), %rdi
callq 0x404fb0
jmp 0x414d94
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x8b(%rbp), %rdi
callq 0x404fb0
jmp 0x414d8b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x404f50
jmp 0x414d8b
movq -0xa0(%rbp), %rax
movq %rax, %rsi
addq $0xf, %rsi
movzbl 0xb(%rax), %edx
movzbl 0xc(%rax), %ecx
movzbl -0x8c(%rbp), %r8d
leaq 0x1868e0(%rip), %rdi    # 0x59b62e
xorl %eax, %eax
callq 0x4f06e0
jmp 0x414d57
movq -0xa0(%rbp), %rax
movb -0x8c(%rbp), %cl
movb %cl, 0xb(%rax)
movb -0x8c(%rbp), %cl
movb %cl, 0xc(%rax)
leaq -0x70(%rbp), %rdi
callq 0x404f50
leaq -0x28(%rbp), %rdi
callq 0x404f50
addq $0xc0, %rsp
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x404f50
movq -0x50(%rbp), %rdi
callq 0x4c9ba0
nopl (%rax)