// File: /workspace/github_c_makefile_star2_O0/Ziddykins[P]Dawn/src/parse.c
// Function: parse_private_message
void parse_private_message(struct Message *message) {
    char out[MAX_MESSAGE_BUFFER];
    int pindex = get_pindex(message->sender_nick);

    if (pindex == -1) {
        sprintf(out, "PRIVMSG %s :You do not have an account\r\n", message->sender_nick);
        add_msg(out, strlen(out));
        return;
    }
/*    if (dawn->players[pindex].max_auth >= AL_REG) {
        sprintf(out, "PRIVMSG %s :Please use ;auth\r\n", message->sender_nick);
        add_msg(out, strlen(out));
        return;
    }
Explain yourself*/

    if (matches_regex(message->message, ";set password (\\w+)")) {
        if (strcmp(message->sender_hostmask, dawn->players[pindex].hostmask) == 0) {
            hash_pwd(dawn->players[pindex].pwd, dawn->players[pindex].salt, regex_group[1]);
            sprintf(out, "PRIVMSG %s :Your password has been set\r\n", message->sender_nick);
        }
        add_msg(out, strlen(out));
    } else if (matches_regex(message->message, ";login (\\w+)")) {
        if (dawn->players[pindex].auth_level < AL_USER) {
            unsigned char hash[SHA256_DIGEST_LENGTH];
            hash_pwd(hash, dawn->players[pindex].salt, regex_group[1]);
            if (hash_cmp(hash, dawn->players[pindex].pwd)) {
                strcpy(dawn->players[pindex].hostmask, message->sender_hostmask);
                snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s has been verified. (USER)\r\n", dawn->active_room,
                         message->sender_nick);
                add_msg(out, strlen(out));
                dawn->players[pindex].auth_level = AL_USER;
                snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :Password correct\r\n", message->sender_nick);
            } else {
                snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :Incorrect password\r\n", message->sender_nick);
            }
        } else {
            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :I already recognize you, no need to log in\r\n", message->sender_nick);
        }
        add_msg(out, strlen(out));
    }

    if (dawn->players[pindex].auth_level >= AL_ADMIN) {
        if (matches_regex(message->message, ";say (.*)")) {
            snprintf(out, MAX_MESSAGE_BUFFER-2, "PRIVMSG %s :%s", dawn->active_room, regex_group[1]);
            strcat(out, "\r\n");
            add_msg(out, strlen(out));
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x200, %rsp            # imm = 0x200
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x13ba0
movl %eax, -0x1a4(%rbp)
cmpl $-0x1, -0x1a4(%rbp)
jne 0x1338e
leaq -0x1a0(%rbp), %rdi
movq -0x8(%rbp), %rdx
leaq 0xd0b4(%rip), %rsi      # 0x2040d
movb $0x0, %al
callq 0x2050
leaq -0x1a0(%rbp), %rax
movq %rax, -0x1d8(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x20c0
movq -0x1d8(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0x13764
movq -0x8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq 0xd096(%rip), %rsi      # 0x20436
callq 0x13090
cmpl $0x0, %eax
je 0x13492
movq -0x8(%rbp), %rdi
addq $0x80, %rdi
leaq 0x156b0(%rip), %rax     # 0x28a70
movq (%rax), %rsi
addq $0x1a0, %rsi            # imm = 0x1A0
movslq -0x1a4(%rbp), %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
addq %rax, %rsi
addq $0x40, %rsi
callq 0x22d0
cmpl $0x0, %eax
jne 0x13464
leaq 0x15680(%rip), %rax     # 0x28a70
movq (%rax), %rdi
addq $0x1a0, %rdi            # imm = 0x1A0
movslq -0x1a4(%rbp), %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
addq %rax, %rdi
addq $0x8f, %rdi
leaq 0x15657(%rip), %rax     # 0x28a70
movq (%rax), %rsi
addq $0x1a0, %rsi            # imm = 0x1A0
movslq -0x1a4(%rbp), %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
addq %rax, %rsi
addq $0x7f, %rsi
leaq 0x13e91(%rip), %rdx     # 0x272d0
addq $0x190, %rdx            # imm = 0x190
callq 0x12ed0
leaq -0x1a0(%rbp), %rdi
movq -0x8(%rbp), %rdx
leaq 0xcfed(%rip), %rsi      # 0x2044a
movb $0x0, %al
callq 0x2050
leaq -0x1a0(%rbp), %rax
movq %rax, -0x1e0(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x20c0
movq -0x1e0(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0x136a0
movq -0x8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq 0xcfcf(%rip), %rsi      # 0x20473
callq 0x13090
cmpl $0x0, %eax
je 0x1369e
leaq 0x155b7(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x1a4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movzbl 0x26a0(%rax), %eax
cmpl $0x1, %eax
jge 0x13657
leaq -0x1d0(%rbp), %rdi
leaq 0x1557f(%rip), %rax     # 0x28a70
movq (%rax), %rsi
addq $0x1a0, %rsi            # imm = 0x1A0
movslq -0x1a4(%rbp), %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
addq %rax, %rsi
addq $0x7f, %rsi
leaq 0x13db9(%rip), %rdx     # 0x272d0
addq $0x190, %rdx            # imm = 0x190
callq 0x12ed0
leaq -0x1d0(%rbp), %rdi
leaq 0x1553f(%rip), %rax     # 0x28a70
movq (%rax), %rsi
addq $0x1a0, %rsi            # imm = 0x1A0
movslq -0x1a4(%rbp), %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
addq %rax, %rsi
addq $0x8f, %rsi
callq 0x12fe0
cmpl $0x0, %eax
je 0x13637
leaq 0x15508(%rip), %rax     # 0x28a70
movq (%rax), %rdi
addq $0x1a0, %rdi            # imm = 0x1A0
movslq -0x1a4(%rbp), %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
addq %rax, %rdi
addq $0x40, %rdi
movq -0x8(%rbp), %rsi
addq $0x80, %rsi
callq 0x21c0
leaq -0x1a0(%rbp), %rdi
leaq 0x154cb(%rip), %rax     # 0x28a70
movq (%rax), %rcx
addq $0x100, %rcx            # imm = 0x100
movq -0x8(%rbp), %r8
movl $0x190, %esi            # imm = 0x190
leaq 0xcec1(%rip), %rdx      # 0x20480
movb $0x0, %al
callq 0x2390
leaq -0x1a0(%rbp), %rax
movq %rax, -0x1e8(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x20c0
movq -0x1e8(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
leaq 0x1547a(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x1a4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movb $0x1, 0x26a0(%rax)
leaq -0x1a0(%rbp), %rdi
movq -0x8(%rbp), %rcx
movl $0x190, %esi            # imm = 0x190
leaq 0xce7d(%rip), %rdx      # 0x204ab
movb $0x0, %al
callq 0x2390
jmp 0x13655
leaq -0x1a0(%rbp), %rdi
movq -0x8(%rbp), %rcx
movl $0x190, %esi            # imm = 0x190
leaq 0xce7c(%rip), %rdx      # 0x204ca
movb $0x0, %al
callq 0x2390
jmp 0x13675
leaq -0x1a0(%rbp), %rdi
movq -0x8(%rbp), %rcx
movl $0x190, %esi            # imm = 0x190
leaq 0xce7d(%rip), %rdx      # 0x204eb
movb $0x0, %al
callq 0x2390
leaq -0x1a0(%rbp), %rax
movq %rax, -0x1f0(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x20c0
movq -0x1f0(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0x136a0
leaq 0x153c9(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x1a4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movzbl 0x26a0(%rax), %eax
cmpl $0x3, %eax
jl 0x13764
movq -0x8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq 0xce41(%rip), %rsi      # 0x20524
callq 0x13090
cmpl $0x0, %eax
je 0x13762
leaq -0x1a0(%rbp), %rdi
leaq 0x15375(%rip), %rax     # 0x28a70
movq (%rax), %rcx
addq $0x100, %rcx            # imm = 0x100
movl $0x18e, %esi            # imm = 0x18E
leaq 0xce1d(%rip), %rdx      # 0x2052e
leaq 0x13bb8(%rip), %r8      # 0x272d0
addq $0x190, %r8             # imm = 0x190
movb $0x0, %al
callq 0x2390
leaq -0x1a0(%rbp), %rdi
leaq 0x9552(%rip), %rsi      # 0x1cc86
callq 0x2400
leaq -0x1a0(%rbp), %rax
movq %rax, -0x1f8(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x20c0
movq -0x1f8(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0x13764
addq $0x200, %rsp            # imm = 0x200
popq %rbp
retq
nopl (%rax)