// File: /workspace/github_c_makefile_star2_O0/Ziddykins[P]Dawn/src/stats.c
// Function: get_stat
void get_stat(struct Message *m, int stats[7]) {
    int i = get_pindex(m->sender_nick);
    if (i == -1) {
        return;
    }
    for (int j = 0; j < (MAX_INVENTORY_SLOTS - dawn->players[i].available_slots); j++) {
        if (is_equipped(i, j)) {
            stats[0] += dawn->players[i].inventory[j].attr_health;
            stats[1] += dawn->players[i].inventory[j].attr_mana;
            stats[2] += dawn->players[i].inventory[j].attr_strength;
            stats[3] += dawn->players[i].inventory[j].attr_intelligence;
            stats[4] += dawn->players[i].inventory[j].attr_mdef;
            stats[5] += dawn->players[i].inventory[j].attr_defense;
        }
    }
    stats[6] = dawn->players[i].alignment;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x13ba0
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
jne 0x16727
jmp 0x1692d
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
leaq 0x12338(%rip), %rcx     # 0x28a70
movq (%rcx), %rdx
addq $0x1a0, %rdx            # imm = 0x1A0
movslq -0x14(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rdx
movl $0x19, %ecx
subl 0x2678(%rdx), %ecx
cmpl %ecx, %eax
jge 0x16902
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %esi
callq 0x9a40
cmpl $0x0, %eax
je 0x168f2
leaq 0x122f2(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x14(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
addq $0x190, %rax            # imm = 0x190
movslq -0x18(%rbp), %rcx
imulq $0x9c, %rcx, %rcx
addq %rcx, %rax
movl 0x64(%rax), %ecx
movq -0x10(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
leaq 0x122b5(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x14(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
addq $0x190, %rax            # imm = 0x190
movslq -0x18(%rbp), %rcx
imulq $0x9c, %rcx, %rcx
addq %rcx, %rax
movl 0x90(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
leaq 0x12273(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x14(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
addq $0x190, %rax            # imm = 0x190
movslq -0x18(%rbp), %rcx
imulq $0x9c, %rcx, %rcx
addq %rcx, %rax
movl 0x70(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
leaq 0x12234(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x14(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
addq $0x190, %rax            # imm = 0x190
movslq -0x18(%rbp), %rcx
imulq $0x9c, %rcx, %rcx
addq %rcx, %rax
movl 0x6c(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
leaq 0x121f5(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x14(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
addq $0x190, %rax            # imm = 0x190
movslq -0x18(%rbp), %rcx
imulq $0x9c, %rcx, %rcx
addq %rcx, %rax
movl 0x74(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x10(%rax), %ecx
movl %ecx, 0x10(%rax)
leaq 0x121b6(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x14(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
addq $0x190, %rax            # imm = 0x190
movslq -0x18(%rbp), %rcx
imulq $0x9c, %rcx, %rcx
addq %rcx, %rax
movl 0x68(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x14(%rax), %ecx
movl %ecx, 0x14(%rax)
jmp 0x168f4
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1672e
leaq 0x12167(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x14(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl 0x2694(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)