// File: /workspace/github_c_makefile_star2_O0/Ziddykins[P]Dawn/src/player.c
// Function: check_levelup
void check_levelup(struct Message *message) {
    int i = get_pindex(message->sender_nick);
    char out[MAX_MESSAGE_BUFFER];
    unsigned long long next_level_exp = get_nextlvl_exp(message->sender_nick);
    unsigned long long curr_level_exp = dawn->players[i].experience;
    int curr_level = dawn->players[i].level;

    if (curr_level_exp >= next_level_exp) {
        dawn->players[i].level++;
        dawn->players[i].max_health += 25;
        dawn->players[i].max_mana += 25;
        dawn->players[i].attr_pts += 20;
        dawn->players[i].health = dawn->players[i].max_health;
        dawn->players[i].mana = dawn->players[i].max_mana;
        check_learn_spells(message->sender_nick);

        if (dawn->players[i].experience > get_nextlvl_exp(message->sender_nick)) {
            check_levelup(message);
            return;
        }

        if (dawn->players[i].experience < get_nextlvl_exp(message->sender_nick)) {
            sprintf(out, "PRIVMSG %s :%s has achieved level %d. 20 attribute points ready for assignment, HP and MP"
                    " increased +25! Increase your attributes using the ;assign command!\r\n",
                    message->receiver, message->sender_nick, curr_level + 1);
            add_msg(out, strlen(out));
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x13ba0
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x14260
movq %rax, -0x1a8(%rbp)
leaq 0x140ee(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xc(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movq 0x2658(%rax), %rax
movq %rax, -0x1b0(%rbp)
leaq 0x140c2(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xc(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl 0x2668(%rax), %eax
movl %eax, -0x1b4(%rbp)
movq -0x1b0(%rbp), %rax
cmpq -0x1a8(%rbp), %rax
jb 0x14c24
leaq 0x14084(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xc(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl 0x2668(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2668(%rax)
leaq 0x14057(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xc(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl 0x2670(%rax), %ecx
addl $0x19, %ecx
movl %ecx, 0x2670(%rax)
leaq 0x1402a(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xc(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl 0x2674(%rax), %ecx
addl $0x19, %ecx
movl %ecx, 0x2674(%rax)
leaq 0x13ffd(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xc(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl 0x2698(%rax), %ecx
addl $0x14, %ecx
movl %ecx, 0x2698(%rax)
leaq 0x13fd0(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xc(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movslq 0x2670(%rax), %rcx
leaq 0x13fab(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xc(%rbp), %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
addq %rdx, %rax
movq %rcx, 0x2650(%rax)
leaq 0x13f86(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xc(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl 0x2674(%rax), %ecx
leaq 0x13f62(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xc(%rbp), %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
addq %rdx, %rax
movl %ecx, 0x2680(%rax)
movq -0x8(%rbp), %rdi
callq 0x16390
leaq 0x13f35(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xc(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movq 0x2658(%rax), %rax
movq %rax, -0x1c0(%rbp)
movq -0x8(%rbp), %rdi
callq 0x14260
movq %rax, %rcx
movq -0x1c0(%rbp), %rax
cmpq %rcx, %rax
jbe 0x14b86
movq -0x8(%rbp), %rdi
callq 0x14950
jmp 0x14c24
leaq 0x13ee3(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xc(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movq 0x2658(%rax), %rax
movq %rax, -0x1c8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x14260
movq %rax, %rcx
movq -0x1c8(%rbp), %rax
cmpq %rcx, %rax
jae 0x14c22
leaq -0x1a0(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0xc0, %rdx
movq -0x8(%rbp), %rcx
movl -0x1b4(%rbp), %r8d
addl $0x1, %r8d
leaq 0xbebf(%rip), %rsi      # 0x20ab1
movb $0x0, %al
callq 0x2050
leaq -0x1a0(%rbp), %rax
movq %rax, -0x1d0(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x20c0
movq -0x1d0(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0x14c24
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
nopl (%rax)