// File: /workspace/github_c_makefile_star2_O0/ajpaulson[P]srogue11/daemons.c
// Function: stomach
int stomach(int fromfuse)
{
	int oldfood, old_hunger;

	old_hunger = hungry_state;
	if (food_left <= 0) {		 /* the hero is fainting */
		if (--food_left == -150) {
			msg("Your stomach writhes with hunger pains.");
		}
		else if (food_left < -350) {
			msg("You starve to death !!");
			msg(" ");
			death(K_STARVE);
		}
		if (player.t_nocmd > 0 || rnd(100) > 20)
			return 0;
		player.t_nocmd = rnd(8)+4;
		msg("You faint.");
		running = FALSE;
		count = 0;
		hungry_state = F_FAINT;
	}
	else {
		oldfood = food_left;
		food_left -= ringfood + foodlev - amulet;
		if (player.t_nocmd > 0)		/* wait till he can move */
			return 0;
		if (food_left < WEAKTIME && oldfood >= WEAKTIME) {
			msg("You are starting to feel weak.");
			hungry_state = F_WEAK;
		}
		else if(food_left < HUNGTIME && oldfood >= HUNGTIME) {
			msg("Getting hungry.");
			hungry_state = F_HUNGRY;
		}
	}
	if (old_hunger != hungry_state)
	    updpack();				/* new pack weight */
	wghtchk(FALSE);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
leaq 0x2cb7e(%rip), %rax     # 0x36d00
movl (%rax), %eax
movl %eax, -0x10(%rbp)
leaq 0x29172(%rip), %rax     # 0x33300
cmpl $0x0, (%rax)
jg 0xa27c
leaq 0x29162(%rip), %rax     # 0x33300
movl (%rax), %eax
addl $-0x1, %eax
leaq 0x29156(%rip), %rcx     # 0x33300
movl %eax, (%rcx)
cmpl $0xffffff6a, %eax       # imm = 0xFFFFFF6A
jne 0xa1c3
leaq 0x1f833(%rip), %rdi     # 0x299ed
movb $0x0, %al
callq 0xd8f0
jmp 0xa1fa
leaq 0x29136(%rip), %rax     # 0x33300
cmpl $0xfffffea2, (%rax)     # imm = 0xFFFFFEA2
jge 0xa1f8
leaq 0x1f83c(%rip), %rdi     # 0x29a15
movb $0x0, %al
callq 0xd8f0
leaq 0x215ab(%rip), %rdi     # 0x2b792
movb $0x0, %al
callq 0xd8f0
movl $0xfffffff7, %edi       # imm = 0xFFFFFFF7
callq 0x18260
jmp 0xa1fa
leaq 0x2cecf(%rip), %rax     # 0x370d0
cmpl $0x0, 0x88(%rax)
jg 0xa21b
movl $0x64, %edi
movb $0x0, %al
callq 0xef20
cmpl $0x14, %eax
jle 0xa227
movl $0x0, -0x4(%rbp)
jmp 0xa36a
movl $0x8, %edi
movb $0x0, %al
callq 0xef20
movl %eax, %ecx
addl $0x4, %ecx
leaq 0x2ce91(%rip), %rax     # 0x370d0
movl %ecx, 0x88(%rax)
leaq 0x1f7e0(%rip), %rdi     # 0x29a2c
movb $0x0, %al
callq 0xd8f0
leaq 0x2cab2(%rip), %rax     # 0x36d0c
movb $0x0, (%rax)
leaq 0x2ca90(%rip), %rax     # 0x36cf4
movl $0x0, (%rax)
leaq 0x2ca8f(%rip), %rax     # 0x36d00
movl $0x3, (%rax)
jmp 0xa347
leaq 0x2907d(%rip), %rax     # 0x33300
movl (%rax), %eax
movl %eax, -0xc(%rbp)
leaq 0x2ca75(%rip), %rax     # 0x36d04
movl (%rax), %eax
leaq 0x29070(%rip), %rcx     # 0x33308
addl (%rcx), %eax
leaq 0x2ca70(%rip), %rcx     # 0x36d11
movb (%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
subl %ecx, %eax
leaq 0x2904e(%rip), %rcx     # 0x33300
movl (%rcx), %ecx
subl %eax, %ecx
leaq 0x29043(%rip), %rax     # 0x33300
movl %ecx, (%rax)
leaq 0x2ce0a(%rip), %rax     # 0x370d0
cmpl $0x0, 0x88(%rax)
jle 0xa2db
movl $0x0, -0x4(%rbp)
jmp 0xa36a
leaq 0x2901e(%rip), %rax     # 0x33300
cmpl $0x96, (%rax)
jge 0xa310
cmpl $0x96, -0xc(%rbp)
jl 0xa310
leaq 0x1f73d(%rip), %rdi     # 0x29a37
movb $0x0, %al
callq 0xd8f0
leaq 0x2c9f8(%rip), %rax     # 0x36d00
movl $0x2, (%rax)
jmp 0xa345
leaq 0x28fe9(%rip), %rax     # 0x33300
cmpl $0x12c, (%rax)          # imm = 0x12C
jge 0xa343
cmpl $0x12c, -0xc(%rbp)      # imm = 0x12C
jl 0xa343
leaq 0x1f727(%rip), %rdi     # 0x29a56
movb $0x0, %al
callq 0xd8f0
leaq 0x2c9c3(%rip), %rax     # 0x36d00
movl $0x1, (%rax)
jmp 0xa345
jmp 0xa347
movl -0x10(%rbp), %eax
leaq 0x2c9af(%rip), %rcx     # 0x36d00
cmpl (%rcx), %eax
je 0xa35c
movb $0x0, %al
callq 0xaba0
xorl %edi, %edi
callq 0xb0e0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)