// File: /workspace/github_c_makefile_star2_O3/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 0x5c73
movq %rax, %rbx
leaq 0x100(%r14), %r15
leaq 0xda57(%rip), %rsi      # 0x1355c
movq %r15, %rdi
callq 0xd3aa
testl %eax, %eax
je 0x5b66
leaq 0x1bf68(%rip), %r12     # 0x21a80
movq (%r12), %rcx
movslq %ebp, %r15
imulq $0x26a8, %r15, %r13     # imm = 0x26A8
cmpw $0x60, 0x2842(%rcx,%r13)
jl 0x5bdd
addq $0x100, %rcx            # imm = 0x100
leaq 0xda28(%rip), %rdx      # 0x1356c
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 0x5bbc
leaq 0xdacb(%rip), %rsi      # 0x13638
movq %r15, %rdi
callq 0xd3aa
testl %eax, %eax
je 0x5c4a
leaq 0x1befc(%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 0x5c03
leaq 0xda9d(%rip), %rdx      # 0x13647
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 0xcefe
addq $0xc0, %r14
leaq 0xda03(%rip), %rdx      # 0x135ee
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2390
movw $0x5, %ax
jmp 0x5c1d
leaq 0xda6b(%rip), %rdx      # 0x13675
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2390
movw $0x6, %ax
leaq 0x1be5c(%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 0xcefe
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2240
callq 0x2726