// File: /workspace/github_c_makefile_star2_O1/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 0x22b0
testq %rax, %rax
je 0x5c0a
movq %rax, %rbx
leaq 0x100(%r14), %r15
leaq 0xda88(%rip), %rsi      # 0x13524
movq %r15, %rdi
callq 0xd1ba
testl %eax, %eax
je 0x5afd
leaq 0x1bfd1(%rip), %r12     # 0x21a80
movq (%r12), %rcx
movslq %ebp, %r15
imulq $0x26a8, %r15, %r13     # imm = 0x26A8
cmpw $0x60, 0x2842(%rcx,%r13)
jl 0x5b74
addq $0x100, %rcx            # imm = 0x100
leaq 0xda59(%rip), %rdx      # 0x13534
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x2390
movq (%r12), %rax
addw $-0xf, 0x2842(%rax,%r13)
jmp 0x5b53
leaq 0xdafc(%rip), %rsi      # 0x13600
movq %r15, %rdi
callq 0xd1ba
testl %eax, %eax
je 0x5be1
leaq 0x1bf65(%rip), %rax     # 0x21a80
movq (%rax), %rax
movslq %ebp, %r15
imulq $0x26a8, %r15, %rdx     # imm = 0x26A8
leaq 0xc0(%r14), %rcx
cmpw $0x60, 0x2842(%rax,%rdx)
jl 0x5b9a
leaq 0xdace(%rip), %rdx      # 0x1360f
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x2390
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 0xcd1c
addq $0xc0, %r14
leaq 0xda34(%rip), %rdx      # 0x135b6
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2390
movw $0x5, %ax
jmp 0x5bb4
leaq 0xda9c(%rip), %rdx      # 0x1363d
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2390
movw $0x6, %ax
leaq 0x1bec5(%rip), %rcx     # 0x21a80
movq (%rcx), %rcx
imulq $0x26a8, %r15, %rdx     # imm = 0x26A8
addw 0x2842(%rcx,%rdx), %ax
cmpw $0x64, %ax
movl $0x64, %esi
cmovll %eax, %esi
movw %si, 0x2842(%rcx,%rdx)
movq %rbx, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcd1c
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2240
callq 0x2726