// File: /workspace/github_c_makefile_star2_O0/ajpaulson[P]srogue11/misc.c
// Function: eat
int eat()
{
	struct linked_list *item;
	struct object *obj;
	int goodfood, cursed;

	if ((item = get_item("eat", FOOD)) == NULL)
		return 0;
	obj = OBJPTR(item);
	if (obj->o_type != FOOD) {
		msg("That's Inedible!");
		after = FALSE;
		return 0;
	}
	cursed = 1;
	if (o_on(obj, ISCURSED))
		cursed += 1;
	else if (o_on(obj, ISBLESS))
		cursed -= 1;
	if (obj->o_which == FRUITFOOD) {
		msg("My, that was a yummy %s.", fruit);
		goodfood = 100;
	}
	else {
		if (rnd(100) > 80 || o_on(obj, ISCURSED)) {
			msg("Yuk, this food tastes like ARA.");
			goodfood = 300;
			him->s_exp += 1;
			check_level();
		}
		else {
			msg("Yum, that tasted good.");
			goodfood = 200;
		}
	}
	goodfood *= cursed;
	if ((food_left += HUNGERTIME + rnd(400) - goodfood) > STOMACHSIZE)
		food_left = STOMACHSIZE;
	hungry_state = F_OKAY;
	updpack();					/* update pack */
	if (obj == cur_weapon)
		cur_weapon = NULL;
	del_pack(item);		/* get rid of the food */
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x1b794(%rip), %rdi     # 0x2b4c3
movl $0x3a, %esi
callq 0x14b90
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
jne 0xfd4f
movl $0x0, -0x4(%rbp)
jmp 0xfeec
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x3a, 0x20(%rax)
je 0xfd89
leaq 0x1b75b(%rip), %rdi     # 0x2b4c7
movb $0x0, %al
callq 0xd8f0
leaq 0x23593(%rip), %rax     # 0x3330d
movb $0x0, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0xfeec
movl $0x1, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xaac0
testb $0x1, %al
jne 0xfda4
jmp 0xfdaf
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xfdce
movq -0x18(%rbp), %rdi
movl $0x20, %esi
callq 0xaac0
testb $0x1, %al
jne 0xfdc3
jmp 0xfdcc
movl -0x20(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xfdce
movq -0x18(%rbp), %rax
cmpl $0x1, 0x28(%rax)
jne 0xfdf6
leaq 0x1b6f9(%rip), %rdi     # 0x2b4d8
leaq 0x275ba(%rip), %rsi     # 0x373a0
movb $0x0, %al
callq 0xd8f0
movl $0x64, -0x1c(%rbp)
jmp 0xfe66
movl $0x64, %edi
movb $0x0, %al
callq 0xef20
cmpl $0x50, %eax
jg 0xfe1b
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xaac0
testb $0x1, %al
jne 0xfe1b
jmp 0xfe4f
leaq 0x1b6cf(%rip), %rdi     # 0x2b4f1
movb $0x0, %al
callq 0xd8f0
movl $0x12c, -0x1c(%rbp)     # imm = 0x12C
leaq 0x27399(%rip), %rax     # 0x371d0
movq (%rax), %rax
movq 0x20(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
movb $0x0, %al
callq 0xcbe0
jmp 0xfe64
leaq 0x1b6bb(%rip), %rdi     # 0x2b511
movb $0x0, %al
callq 0xd8f0
movl $0xc8, -0x1c(%rbp)
jmp 0xfe66
movl -0x20(%rbp), %eax
imull -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl $0x190, %edi            # imm = 0x190
movb $0x0, %al
callq 0xef20
addl $0x514, %eax            # imm = 0x514
subl -0x1c(%rbp), %eax
leaq 0x23475(%rip), %rcx     # 0x33300
addl (%rcx), %eax
leaq 0x2346c(%rip), %rcx     # 0x33300
movl %eax, (%rcx)
cmpl $0x7d0, %eax            # imm = 0x7D0
jle 0xfeaa
leaq 0x2345c(%rip), %rax     # 0x33300
movl $0x7d0, (%rax)          # imm = 0x7D0
leaq 0x26e4f(%rip), %rax     # 0x36d00
movl $0x0, (%rax)
movb $0x0, %al
callq 0xaba0
movq -0x18(%rbp), %rax
leaq 0x26df7(%rip), %rcx     # 0x36cc0
cmpq (%rcx), %rax
jne 0xfedc
leaq 0x26deb(%rip), %rax     # 0x36cc0
movq $0x0, (%rax)
movq -0x10(%rbp), %rdi
callq 0x150f0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)