// File: /workspace/github_c_makefile_star2_O0/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_auth
void cmd_auth(int pindex, struct Message * msg) {
    char * out;
    CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))
    if(matches_regex(msg->message, CMD_LIT" (\\w+)")) {
        if(auth_key_valid && strcmp(auth_key, regex_group[1]) == 0) {
            auth_key_valid = 0;
            free(auth_key);
            auth_key = 0;
            dawn->players[pindex].auth_level = AL_ROOT;
            dawn->players[pindex].max_auth = AL_ROOT;
            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s has been verified. (%s)\r\n",
                dawn->active_room,
                dawn->players[pindex].username,
                auth_level_to_str(dawn->players[pindex].auth_level));
            add_msg(out, strlen(out));
        } else {
            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :Invalid auth_key!\r\n", dawn->active_room);
            add_msg(out, strlen(out));
        }
    } else if(matches_regex(msg->message, CMD_LIT)) {
        snprintf(out, MAX_MESSAGE_BUFFER, "WHOIS %s\r\n", dawn->players[pindex].username);
        add_msg(out, strlen(out));
    }
    free(out);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x190, %edi            # imm = 0x190
callq 0x22b0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x5be9
leaq 0x15d8a(%rip), %rdi     # 0x1b964
callq 0x2190
movl $0x1, %edi
callq 0x2260
movq -0x10(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq 0x15db4(%rip), %rsi     # 0x1b9af
callq 0x13090
cmpl $0x0, %eax
je 0x5d9d
cmpl $0x0, 0x20660(%rip)     # 0x26270
je 0x5d56
leaq 0x2065b(%rip), %rax     # 0x26278
movq (%rax), %rdi
leaq 0x216a9(%rip), %rsi     # 0x272d0
addq $0x190, %rsi            # imm = 0x190
callq 0x22d0
cmpl $0x0, %eax
jne 0x5d56
movl $0x0, 0x2062a(%rip)     # 0x26270
leaq 0x2062b(%rip), %rax     # 0x26278
movq (%rax), %rdi
callq 0x2240
leaq 0x2061c(%rip), %rax     # 0x26278
movq $0x0, (%rax)
leaq 0x22e06(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movb $0x4, 0x26a0(%rax)
leaq 0x22de1(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movb $0x4, 0x26a1(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0x22db4(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, -0x30(%rbp)
leaq 0x22da0(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movq %rax, -0x28(%rbp)
leaq 0x22d7e(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movzbl 0x26a0(%rax), %edi
callq 0x15110
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %r8
movq %rax, %r9
movl $0x190, %esi            # imm = 0x190
leaq 0x15c90(%rip), %rdx     # 0x1b9c0
movb $0x0, %al
callq 0x2390
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20c0
movq -0x20(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0x5d9b
movq -0x18(%rbp), %rdi
leaq 0x22d0f(%rip), %rax     # 0x28a70
movq (%rax), %rcx
addq $0x100, %rcx            # imm = 0x100
movl $0x190, %esi            # imm = 0x190
leaq 0x15c72(%rip), %rdx     # 0x1b9e9
movb $0x0, %al
callq 0x2390
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20c0
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0x5e0e
movq -0x10(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq 0x15c5a(%rip), %rsi     # 0x1ba09
callq 0x13090
cmpl $0x0, %eax
je 0x5e0c
movq -0x18(%rbp), %rdi
leaq 0x22cac(%rip), %rax     # 0x28a70
movq (%rax), %rcx
addq $0x1a0, %rcx            # imm = 0x1A0
movslq -0x4(%rbp), %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
addq %rax, %rcx
movl $0x190, %esi            # imm = 0x190
leaq 0x15b46(%rip), %rdx     # 0x1b92e
movb $0x0, %al
callq 0x2390
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20c0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0x5e0e
movq -0x18(%rbp), %rdi
callq 0x2240
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)