// File: /workspace/github_c_makefile_star2_O3/Ziddykins[P]Dawn/src/monsters.c
// Function: monster_buff
static void monster_buff(enum MonsterType type, int pindex, int global) {
    switch (type) {
        case BERSERKER:
            global ? (dawn->global_monster.hp *= 2) : (dawn->players[pindex].personal_monster.hp *= 2);
            global ? (dawn->global_monster.str *= 2) : (dawn->players[pindex].personal_monster.str *= 2);
            global ? (dawn->global_monster.def *= 2) : (dawn->players[pindex].personal_monster.def *= 2);
            global ? (dawn->global_monster.intel *= 2) : (dawn->players[pindex].personal_monster.intel *= 2);
            global ? (dawn->global_monster.mdef *= 2) : (dawn->players[pindex].personal_monster.mdef *= 2);
            break;
        case ELDER:
            global ? (dawn->global_monster.exp *= 3) : (dawn->players[pindex].personal_monster.exp *= 3);
            break;
        case THIEF:
            global ? (dawn->global_monster.def *= 4) : (dawn->players[pindex].personal_monster.def *= 4);
            break;
        case TANK:
            global ? (dawn->global_monster.gold *= 5) : (dawn->players[pindex].personal_monster.gold *= 4);
            break;
        case BOSS:
            global ? (dawn->global_monster.hp *= 10) : (dawn->players[pindex].personal_monster.hp *= 10);
            global ? (dawn->global_monster.str *= 10) : (dawn->players[pindex].personal_monster.str *= 10);
            global ? (dawn->global_monster.def *= 10) : (dawn->players[pindex].personal_monster.def *= 10);
            global ? (dawn->global_monster.intel *= 10) : (dawn->players[pindex].personal_monster.intel *= 10);
            global ? (dawn->global_monster.mdef *= 10) : (dawn->players[pindex].personal_monster.mdef *= 10);
            global ? (dawn->global_monster.exp *= 6) : (dawn->players[pindex].personal_monster.exp *= 6);
            global ? (dawn->global_monster.gold *= 6) : (dawn->players[pindex].personal_monster.gold *= 6);
            break;
        case DEFMON:
            break;
    }
}

// Assembly:
cmpl $0x4, %edi
ja 0xc397
movl %edi, %eax
leaq 0xa5df(%rip), %rcx      # 0x167a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x158a7(%rip), %rax     # 0x21a80
movq (%rax), %rax
testl %edx, %edx
je 0xc370
shll 0xf2e40(%rax)
movdqu 0xf2e48(%rax), %xmm0
paddd %xmm0, %xmm0
movdqu %xmm0, 0xf2e48(%rax)
retq
leaq 0x1587a(%rip), %rax     # 0x21a80
movq (%rax), %rax
testl %edx, %edx
je 0xc2d1
movl 0xf2e40(%rax), %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
movl %ecx, 0xf2e40(%rax)
movdqu 0xf2e48(%rax), %xmm0
movdqa 0xa54e(%rip), %xmm1     # 0x16780
pshufd $0xf5, %xmm0, %xmm2     # xmm2 = xmm0[1,1,3,3]
pmuludq %xmm1, %xmm0
pshufd $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3]
pmuludq %xmm1, %xmm2
pshufd $0xe8, %xmm2, %xmm1     # xmm1 = xmm2[0,2,2,3]
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movdqu %xmm0, 0xf2e48(%rax)
movl 0xf2e5c(%rax), %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,2), %ecx
movl %ecx, 0xf2e5c(%rax)
movl 0xf2e58(%rax), %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,2), %ecx
jmp 0xc2a8
leaq 0x15806(%rip), %rax     # 0x21a80
movq (%rax), %rax
testl %edx, %edx
je 0xc34a
shll $0x2, 0xf2e48(%rax)
retq
leaq 0x157ec(%rip), %rax     # 0x21a80
movq (%rax), %rax
testl %edx, %edx
je 0xc35d
movl 0xf2e58(%rax), %ecx
leal (%rcx,%rcx,4), %ecx
movl %ecx, 0xf2e58(%rax)
retq
leaq 0x157ca(%rip), %rax     # 0x21a80
movq (%rax), %rax
testl %edx, %edx
je 0xc398
movl 0xf2e5c(%rax), %ecx
leal (%rcx,%rcx,2), %ecx
movl %ecx, 0xf2e5c(%rax)
retq
movslq %esi, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
movl 0x12ac(%rax,%rcx), %edx
addl %edx, %edx
leal (%rdx,%rdx,4), %edx
movl %edx, 0x12ac(%rax,%rcx)
movdqu 0x12b4(%rax,%rcx), %xmm0
movdqa 0xa481(%rip), %xmm1     # 0x16780
pshufd $0xf5, %xmm0, %xmm2     # xmm2 = xmm0[1,1,3,3]
pmuludq %xmm1, %xmm0
pshufd $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3]
pmuludq %xmm1, %xmm2
pshufd $0xe8, %xmm2, %xmm1     # xmm1 = xmm2[0,2,2,3]
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movdqu %xmm0, 0x12b4(%rax,%rcx)
movl 0x12c8(%rax,%rcx), %edx
addl %edx, %edx
leal (%rdx,%rdx,2), %edx
movl %edx, 0x12c8(%rax,%rcx)
movl 0x12c4(%rax,%rcx), %edx
addl %edx, %edx
leal (%rdx,%rdx,2), %edx
movl %edx, 0x12c4(%rax,%rcx)
retq
movslq %esi, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
shll $0x2, 0x12b4(%rax,%rcx)
retq
movslq %esi, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
shll $0x2, 0x12c4(%rax,%rcx)
retq
movslq %esi, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
shll 0x12ac(%rax,%rcx)
movdqu 0x12b4(%rax,%rcx), %xmm0
paddd %xmm0, %xmm0
movdqu %xmm0, 0x12b4(%rax,%rcx)
retq
movslq %esi, %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
movl 0x12c8(%rax,%rcx), %edx
leal (%rdx,%rdx,2), %edx
movl %edx, 0x12c8(%rax,%rcx)
retq