// File: /workspace/github_c_makefile_star2_O0/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_drink
void cmd_drink(int pindex, struct Message * msg) {
    char * out;
    CALLEXIT(!(out = malloc(MAX_MESSAGE_BUFFER)))
    if(matches_regex(msg->message, CMD_LIT " beer")) {
        if (dawn->players[pindex].fullness + 5 > 100) {
            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s takes two more sips and projectile vomits"
                    " all over the patrons. Perhaps you've had enough to drink. Fullness -15\r\n",
                    dawn->active_room, msg->sender_nick);
            dawn->players[pindex].fullness -= 15;
            add_msg(out, strlen(out));
            return;
        }
        snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :You help yourself to a good 'ol bottle of beer. Fullness +5\r\n", msg->receiver);
        dawn->players[pindex].fullness+=5;
        if(dawn->players[pindex].fullness > 100)
            dawn->players[pindex].fullness = 100;

    } else if (matches_regex(msg->message, CMD_LIT " tea")) {
        if (dawn->players[pindex].fullness + 5 > 100) {
            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :Now is not the time for tea, %s\r\n", msg->receiver, msg->sender_nick);
            add_msg(out, strlen(out));
            return;
        }
        snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :You sip tea with your pinkie out. Fullness +6\r\n", msg->receiver);
        dawn->players[pindex].fullness += 6;
        if (dawn->players[pindex].fullness > 100)
            dawn->players[pindex].fullness = 100;
    }
    add_msg(out, strlen(out));
    free(out);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x190, %edi            # imm = 0x190
callq 0x22b0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x65e9
leaq 0x15f07(%rip), %rdi     # 0x1c4e1
callq 0x2190
movl $0x1, %edi
callq 0x2260
movq -0x10(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq 0x15f31(%rip), %rsi     # 0x1c52c
callq 0x13090
cmpl $0x0, %eax
je 0x675a
leaq 0x22460(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movswl 0x26a2(%rax), %eax
addl $0x5, %eax
cmpl $0x64, %eax
jle 0x66b3
movq -0x18(%rbp), %rdi
leaq 0x2242f(%rip), %rax     # 0x28a70
movq (%rax), %rcx
addq $0x100, %rcx            # imm = 0x100
movq -0x10(%rbp), %r8
movl $0x190, %esi            # imm = 0x190
leaq 0x15ee1(%rip), %rdx     # 0x1c53c
movb $0x0, %al
callq 0x2390
leaq 0x22407(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movswl 0x26a2(%rax), %ecx
subl $0xf, %ecx
movw %cx, 0x26a2(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20c0
movq -0x20(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0x68bb
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rcx
addq $0xc0, %rcx
movl $0x190, %esi            # imm = 0x190
leaq 0x15ef0(%rip), %rdx     # 0x1c5be
movb $0x0, %al
callq 0x2390
leaq 0x22394(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movswl 0x26a2(%rax), %ecx
addl $0x5, %ecx
movw %cx, 0x26a2(%rax)
leaq 0x22365(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movswl 0x26a2(%rax), %eax
cmpl $0x64, %eax
jle 0x6755
leaq 0x2233b(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movw $0x64, 0x26a2(%rax)
jmp 0x6895
movq -0x10(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq 0x15e9c(%rip), %rsi     # 0x1c608
callq 0x13090
cmpl $0x0, %eax
je 0x6893
leaq 0x222ef(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movswl 0x26a2(%rax), %eax
addl $0x5, %eax
cmpl $0x64, %eax
jle 0x67ef
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rcx
addq $0xc0, %rcx
movq -0x10(%rbp), %r8
movl $0x190, %esi            # imm = 0x190
leaq 0x15e51(%rip), %rdx     # 0x1c617
movb $0x0, %al
callq 0x2390
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20c0
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0x68bb
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rcx
addq $0xc0, %rcx
movl $0x190, %esi            # imm = 0x190
leaq 0x15e3b(%rip), %rdx     # 0x1c645
movb $0x0, %al
callq 0x2390
leaq 0x22258(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movswl 0x26a2(%rax), %ecx
addl $0x6, %ecx
movw %cx, 0x26a2(%rax)
leaq 0x22229(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movswl 0x26a2(%rax), %eax
cmpl $0x64, %eax
jle 0x6891
leaq 0x221ff(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movw $0x64, 0x26a2(%rax)
jmp 0x6893
jmp 0x6895
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20c0
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
movq -0x18(%rbp), %rdi
callq 0x2240
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)