// File: /workspace/github_c_makefile_star2_O0/Ziddykins[P]Dawn/src/commands.c
// Function: cmd_eat
void cmd_eat (int pindex, struct Message *msg) {
    char *out;
    CALLEXIT(!(out=malloc(MAX_MESSAGE_BUFFER)))

    if (matches_regex(msg->message, CMD_LIT " cheese")) {
        if (dawn->players[pindex].cheese > 0) {
            if (dawn->players[pindex].fullness + 10 > 100) {
                snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s decides it would be a good idea not to have anymore cheese.\r\n", msg->receiver, msg->sender_nick);
                add_msg(out, strlen(out));
                return;
            }
            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s eats a large wedge of cheese. Mmm, cheese. Fullness +10!\r\n", msg->receiver, msg->sender_nick);
            dawn->players[pindex].fullness += 10;
            dawn->players[pindex].cheese -= 1;
            if (dawn->players[pindex].fullness > 100)
                dawn->players[pindex].fullness = 100;
            add_msg(out, strlen(out));
        } else {
            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s, you have no cheese left :(\r\n", msg->receiver, msg->sender_nick);
            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 0x6a79
leaq 0x15c17(%rip), %rdi     # 0x1c681
callq 0x2190
movl $0x1, %edi
callq 0x2260
movq -0x10(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq 0x15c3f(%rip), %rsi     # 0x1c6ca
callq 0x13090
cmpl $0x0, %eax
je 0x6c70
leaq 0x21fd0(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
cmpl $0x0, 0x269c(%rax)
jle 0x6c2b
leaq 0x21fa5(%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 $0xa, %eax
cmpl $0x64, %eax
jle 0x6b39
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rcx
addq $0xc0, %rcx
movq -0x10(%rbp), %r8
movl $0x190, %esi            # imm = 0x190
leaq 0x15bcc(%rip), %rdx     # 0x1c6dc
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 0x6c79
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rcx
addq $0xc0, %rcx
movq -0x10(%rbp), %r8
movl $0x190, %esi            # imm = 0x190
leaq 0x15bd1(%rip), %rdx     # 0x1c729
movb $0x0, %al
callq 0x2390
leaq 0x21f0a(%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 $0xa, %ecx
movw %cx, 0x26a2(%rax)
leaq 0x21edb(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x4(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl 0x269c(%rax), %ecx
subl $0x1, %ecx
movl %ecx, 0x269c(%rax)
leaq 0x21eae(%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 0x6c0c
leaq 0x21e84(%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)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20c0
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0x6c6e
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rcx
addq $0xc0, %rcx
movq -0x10(%rbp), %r8
movl $0x190, %esi            # imm = 0x190
leaq 0x15b29(%rip), %rdx     # 0x1c773
movb $0x0, %al
callq 0x2390
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20c0
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0x6c70
movq -0x18(%rbp), %rdi
callq 0x2240
addq $0x30, %rsp
popq %rbp
retq
nop