// File: /workspace/github_c_makefile_star2_O0/Ziddykins[P]Dawn/src/parse.c
// Function: parse_room_message
void parse_room_message(struct Message *message) {
    char out[MAX_MESSAGE_BUFFER];
    if (strcmp(message->message, ";new") == 0) {
        init_new_character(message);
    }

    //Check if a user has an account and is logged in from the correct host
    if (matches_regex(message->message, "^;(.*)")) {
        int pindex = get_pindex(message->sender_nick);

        //store command to check if user can execute it in current state
        matches_regex(message->message, "^;(.*?)\\s");

        if (pindex == -1) {
            sprintf(out, "PRIVMSG %s :Please create a new account by issuing ';new'\r\n", message->receiver);
            add_msg(out, strlen(out));
            return;
        }

        if (dawn->players[pindex].auth_level &&
                strcmp(dawn->players[pindex].hostmask, message->sender_hostmask) != 0) {
            sprintf(out, "PRIVMSG %s :%s, I've updated your hostmask\r\n", message->receiver, message->sender_nick);
            strcpy(dawn->players[pindex].hostmask, message->sender_hostmask);
            add_msg(out, strlen(out));
        }

        if (strcmp(dawn->players[pindex].hostmask, message->sender_hostmask) != 0
            && dawn->players[pindex].auth_level != 1) {
            sprintf(out, "PRIVMSG %s :%s, I seem to recall you connecting from a different host. Please login "
                    "by sending me a private message containing: ;login <your_password>\r\n",
                    message->receiver, message->sender_nick);
            add_msg(out, strlen(out));
            return;
        }

        if (!command_allowed(regex_group[1], pindex)) {
            sprintf(out, "PRIVMSG %s :This command cannot be used at this time\r\n",  message->receiver);
            add_msg(out, strlen(out));
            return;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq 0x6e3d(%rip), %rsi      # 0x1a6ae
callq 0x22d0
cmpl $0x0, %eax
jne 0x13884
movq -0x8(%rbp), %rdi
callq 0x13cc0
movq -0x8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq 0xccbc(%rip), %rsi      # 0x20552
callq 0x13090
cmpl $0x0, %eax
je 0x13b36
movq -0x8(%rbp), %rdi
callq 0x13ba0
movl %eax, -0x1a4(%rbp)
movq -0x8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq 0xcc94(%rip), %rsi      # 0x20559
callq 0x13090
cmpl $-0x1, -0x1a4(%rbp)
jne 0x13921
leaq -0x1a0(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0xc0, %rdx
leaq 0x6dc7(%rip), %rsi      # 0x1a6b3
movb $0x0, %al
callq 0x2050
leaq -0x1a0(%rbp), %rax
movq %rax, -0x1b0(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x20c0
movq -0x1b0(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0x13b36
leaq 0x15148(%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 $0x0, %eax
je 0x13a14
leaq 0x15117(%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 0x22d0
cmpl $0x0, %eax
je 0x13a14
leaq -0x1a0(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0xc0, %rdx
movq -0x8(%rbp), %rcx
leaq 0xcbb5(%rip), %rsi      # 0x20563
movb $0x0, %al
callq 0x2050
leaq 0x150b4(%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), %rax
movq %rax, -0x1b8(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x20c0
movq -0x1b8(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
leaq 0x15055(%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 0x22d0
cmpl $0x0, %eax
je 0x13acb
leaq 0x1501a(%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
je 0x13acb
leaq -0x1a0(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0xc0, %rdx
movq -0x8(%rbp), %rcx
leaq 0xcaf7(%rip), %rsi      # 0x20590
movb $0x0, %al
callq 0x2050
leaq -0x1a0(%rbp), %rax
movq %rax, -0x1c0(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x20c0
movq -0x1c0(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0x13b36
movl -0x1a4(%rbp), %esi
leaq 0x137f8(%rip), %rdi     # 0x272d0
addq $0x190, %rdi            # imm = 0x190
callq 0x13770
cmpl $0x0, %eax
jne 0x13b34
leaq -0x1a0(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0xc0, %rdx
leaq 0xcb27(%rip), %rsi      # 0x20629
movb $0x0, %al
callq 0x2050
leaq -0x1a0(%rbp), %rax
movq %rax, -0x1c8(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x20c0
movq -0x1c8(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0x13b36
jmp 0x13b36
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
nop