// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
movl $0x190, %edi            # imm = 0x190
callq 0x22c0
testq %rax, %rax
je 0x4e44
movq %rax, %rbx
leaq 0x100(%r14), %r15
leaq 0xd84c(%rip), %rsi      # 0x12524
movq %r15, %rdi
callq 0xc187
testl %eax, %eax
je 0x4d39
leaq 0x1ad95(%rip), %r12     # 0x1fa80
movq (%r12), %rcx
movslq %ebp, %r15
imulq $0x26a8, %r15, %r13     # imm = 0x26A8
cmpw $0x60, 0x2842(%rcx,%r13)
jl 0x4db0
addq $0x100, %rcx            # imm = 0x100
leaq 0xd81d(%rip), %rdx      # 0x12534
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x23a0
movq (%r12), %rax
addw $-0xf, 0x2842(%rax,%r13)
jmp 0x4d8f
leaq 0xd8c0(%rip), %rsi      # 0x12600
movq %r15, %rdi
callq 0xc187
testl %eax, %eax
je 0x4e1b
leaq 0x1ad29(%rip), %rax     # 0x1fa80
movq (%rax), %rax
movslq %ebp, %r15
imulq $0x26a8, %r15, %rdx     # imm = 0x26A8
leaq 0xc0(%r14), %rcx
cmpw $0x60, 0x2842(%rax,%rdx)
jl 0x4dd6
leaq 0xd892(%rip), %rdx      # 0x1260f
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x23a0
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbd04
addq $0xc0, %r14
leaq 0xd7f8(%rip), %rdx      # 0x125b6
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x23a0
movw $0x5, %ax
jmp 0x4df0
leaq 0xd860(%rip), %rdx      # 0x1263d
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
xorl %eax, %eax
callq 0x23a0
movw $0x6, %ax
leaq 0x1ac89(%rip), %rcx     # 0x1fa80
movq (%rcx), %rcx
imulq $0x26a8, %r15, %rdx     # imm = 0x26A8
addw 0x2842(%rcx,%rdx), %ax
cmpw $0x64, %ax
pushq $0x64
popq %rsi
cmovll %eax, %esi
movw %si, 0x2842(%rcx,%rdx)
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbd04
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2250
leaq 0xd68e(%rip), %rdi      # 0x124d9
callq 0x2190
pushq $0x1
popq %rdi
callq 0x2270