// File: /workspace/github_c_makefile_star2_O0/Ziddykins[P]Dawn/src/player.c
// Function: assign_attr_points
void assign_attr_points(struct Message *message, char *which, int amount) {
    int pindex = get_pindex(message->sender_nick);
    int attr_pts = dawn->players[pindex].attr_pts;
    char out[MAX_MESSAGE_BUFFER];

    if (strcmp(which, "str") == 0 && attr_pts >= amount) {
        dawn->players[pindex].strength += amount;
    } else if (strcmp(which, "def") == 0 && attr_pts >= amount) {
        dawn->players[pindex].defense += amount;
    } else if (strcmp(which, "int") == 0 && attr_pts >= amount) {
        dawn->players[pindex].intelligence += amount;
    } else if (strcmp(which, "mdef") == 0 && attr_pts >= amount) {
        dawn->players[pindex].m_def += amount;
    } else {
        sprintf(out, "PRIVMSG %s :%s, you have chosen an invalid attribute to increase or do not have the amount "
                "of attribute points required: (%d points available)\r\n", message->receiver, message->sender_nick, attr_pts);
        add_msg(out, strlen(out));
        return;
    }
    dawn->players[pindex].attr_pts -= amount;
    sprintf(out, "PRIVMSG %s :%s has increased %s by %d, you have %d attribute points available\r\n", message->receiver,
            message->sender_nick, which, amount, attr_pts - amount);
    add_msg(out, strlen(out));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
callq 0x13ba0
movl %eax, -0x18(%rbp)
leaq 0x13e17(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x18(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl 0x2698(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xbecc(%rip), %rsi      # 0x20b50
callq 0x22d0
cmpl $0x0, %eax
jne 0x14cc8
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jl 0x14cc8
movl -0x14(%rbp), %ecx
leaq 0x13dd0(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x18(%rbp), %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
addq %rdx, %rax
addl 0x2684(%rax), %ecx
movl %ecx, 0x2684(%rax)
jmp 0x14e0e
movq -0x10(%rbp), %rdi
leaq 0xbe86(%rip), %rsi      # 0x20b59
callq 0x22d0
cmpl $0x0, %eax
jne 0x14d17
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jl 0x14d17
movl -0x14(%rbp), %ecx
leaq 0x13d81(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x18(%rbp), %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
addq %rdx, %rax
addl 0x268c(%rax), %ecx
movl %ecx, 0x268c(%rax)
jmp 0x14e0c
movq -0x10(%rbp), %rdi
leaq 0xbe32(%rip), %rsi      # 0x20b54
callq 0x22d0
cmpl $0x0, %eax
jne 0x14d66
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jl 0x14d66
movl -0x14(%rbp), %ecx
leaq 0x13d32(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x18(%rbp), %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
addq %rdx, %rax
addl 0x2688(%rax), %ecx
movl %ecx, 0x2688(%rax)
jmp 0x14e0a
movq -0x10(%rbp), %rdi
leaq 0xbde7(%rip), %rsi      # 0x20b58
callq 0x22d0
cmpl $0x0, %eax
jne 0x14db2
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jl 0x14db2
movl -0x14(%rbp), %ecx
leaq 0x13ce3(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x18(%rbp), %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
addq %rdx, %rax
addl 0x2690(%rax), %ecx
movl %ecx, 0x2690(%rax)
jmp 0x14e08
leaq -0x1b0(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0xc0, %rdx
movq -0x8(%rbp), %rcx
movl -0x1c(%rbp), %r8d
leaq 0xbd8a(%rip), %rsi      # 0x20b5d
movb $0x0, %al
callq 0x2050
leaq -0x1b0(%rbp), %rax
movq %rax, -0x1b8(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x20c0
movq -0x1b8(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0x14e9b
jmp 0x14e0a
jmp 0x14e0c
jmp 0x14e0e
movl -0x14(%rbp), %edx
leaq 0x13c58(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x18(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl 0x2698(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x2698(%rax)
leaq -0x1b0(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0xc0, %rdx
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %r8
movl -0x14(%rbp), %r9d
movl -0x1c(%rbp), %eax
subl -0x14(%rbp), %eax
leaq 0xbd86(%rip), %rsi      # 0x20bee
movl %eax, (%rsp)
movb $0x0, %al
callq 0x2050
leaq -0x1b0(%rbp), %rax
movq %rax, -0x1c0(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x20c0
movq -0x1c0(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
nopw %cs:(%rax,%rax)