// File: /workspace/github_c_makefile_star2_O0/ajpaulson[P]srogue11/new_leve.c
// Function: put_things
int put_things()
{
	int i, cnt, rm;
	struct linked_list *item;
	struct object *cur;
	struct coord tp;

	/* Throw away stuff left on the previous level (if anything) */

	free_list(lvl_obj);

	/* The only way to get new stuff is to go down into the dungeon. */

	if (goingup())
		return 0;

	/* Do MAXOBJ attempts to put things on a level */

	for (i = 0; i < MAXOBJ; i++)
	{
		if (rnd(100) < 40)
		{
			item = new_thing(FALSE, ANYTHING);
			attach(lvl_obj, item);
			cur = OBJPTR(item);
			cnt = 0;
			do {
				/* skip treasure rooms */
				rm = rnd_room();
				if (++cnt > 500)
					break;
			} while(rf_on(&rooms[rm],ISTREAS) && levtype!=MAZELEV);

			tp = *rnd_pos(&rooms[rm]);
			mvaddch(tp.y, tp.x, cur->o_type);
			cur->o_pos = tp;
		}
	}
	/*
	 * If he is really deep in the dungeon and he hasn't found the
	 * amulet yet, put it somewhere on the ground
	 */
	if (level >= AMLEVEL && !amulet && rnd(100) < 70)
	{
		item = new_thing(FALSE, AMULET, 0);
		attach(lvl_obj, item);
		cur = OBJPTR(item);
		rm = rnd_room();
		tp = *rnd_pos(&rooms[rm]);
		mvaddch(tp.y, tp.x, cur->o_type);
		cur->o_pos = tp;
	}

	for (i = 0; i < MAXROOMS; i++)		/* loop through all */
	{
		if (rf_on(&rooms[i],ISTREAS))	/* treasure rooms */
		{
			int numthgs, isfood;

			numthgs = rnd(level / 3) + 6;
			while (numthgs-- >= 0)
			{
				isfood = TRUE;
				do {
					item = new_thing(TRUE, ANYTHING);
					cur = OBJPTR(item);

					/* dont create food for */
					if (cur->o_type == FOOD)
						discard(item);

					/* treasure rooms */
					else
						isfood = FALSE;

				} while (isfood);

				attach(lvl_obj, item);
				tp = *rnd_pos(&rooms[i]);
				mvaddch(tp.y, tp.x, cur->o_type);
				cur->o_pos = tp;
			}
		}
	}
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
leaq 0x23679(%rip), %rdi     # 0x36cb8
callq 0xe450
leaq 0x1fca5(%rip), %rax     # 0x332f0
movl (%rax), %eax
leaq 0x1fca8(%rip), %rcx     # 0x332fc
cmpl (%rcx), %eax
jge 0x13664
movl $0x0, -0x4(%rbp)
jmp 0x1398a
movl $0x0, -0x8(%rbp)
cmpl $0x9, -0x8(%rbp)
jge 0x13785
movl $0x64, %edi
movb $0x0, %al
callq 0xef20
cmpl $0x28, %eax
jge 0x13775
xorl %edi, %edi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %edx, %esi
callq 0x24020
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq 0x23611(%rip), %rdi     # 0x36cb8
callq 0xe3e0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0xc(%rbp)
callq 0x135d0
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0x1f4, %eax            # imm = 0x1F4
jle 0x136d9
jmp 0x1371a
jmp 0x136db
movslq -0x10(%rbp), %rax
leaq 0x2363a(%rip), %rdi     # 0x36d20
imulq $0x68, %rax, %rax
addq %rax, %rdi
movl $0x4, %esi
callq 0x19950
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x31(%rbp)
je 0x13713
leaq 0x235ca(%rip), %rax     # 0x36cd4
cmpl $0x2, (%rax)
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x136bf
movslq -0x10(%rbp), %rax
leaq 0x235fb(%rip), %rdi     # 0x36d20
imulq $0x68, %rax, %rax
addq %rax, %rdi
callq 0x19c00
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq 0x1f881(%rip), %rax     # 0x32fc0
movq (%rax), %rdi
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0x13754
jmp 0x1376a
movq 0x1f865(%rip), %rax     # 0x32fc0
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movl 0x20(%rax), %esi
callq 0x64c0
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x13777
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x1366b
leaq 0x1fb64(%rip), %rax     # 0x332f0
cmpl $0x23, (%rax)
jl 0x1384b
leaq 0x23575(%rip), %rax     # 0x36d11
testb $0x1, (%rax)
jne 0x1384b
movl $0x64, %edi
movb $0x0, %al
callq 0xef20
cmpl $0x46, %eax
jge 0x1384b
xorl %edx, %edx
movl $0x2c, %esi
movl %edx, %edi
callq 0x24020
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq 0x234e1(%rip), %rdi     # 0x36cb8
callq 0xe3e0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
callq 0x135d0
movl %eax, -0x10(%rbp)
movslq -0x10(%rbp), %rax
leaq 0x23525(%rip), %rdi     # 0x36d20
imulq $0x68, %rax, %rax
addq %rax, %rdi
callq 0x19c00
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq 0x1f7ab(%rip), %rax     # 0x32fc0
movq (%rax), %rdi
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0x1382a
jmp 0x13840
movq 0x1f78f(%rip), %rax     # 0x32fc0
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movl 0x20(%rax), %esi
callq 0x64c0
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, (%rax)
movl $0x0, -0x8(%rbp)
cmpl $0x9, -0x8(%rbp)
jge 0x13983
movslq -0x8(%rbp), %rax
leaq 0x234b9(%rip), %rdi     # 0x36d20
imulq $0x68, %rax, %rax
addq %rax, %rdi
movl $0x4, %esi
callq 0x19950
cmpl $0x0, %eax
je 0x13973
leaq 0x1fa68(%rip), %rax     # 0x332f0
movl (%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %eax, %edi
movb $0x0, %al
callq 0xef20
addl $0x6, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x2c(%rbp)
cmpl $0x0, %eax
jl 0x13971
movl $0x1, -0x30(%rbp)
movl $0x1, %edi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %edx, %esi
callq 0x24020
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x3a, 0x20(%rax)
jne 0x138f2
movq -0x18(%rbp), %rdi
callq 0xe490
jmp 0x138f9
movl $0x0, -0x30(%rbp)
jmp 0x138fb
cmpl $0x0, -0x30(%rbp)
jne 0x138bc
movq -0x18(%rbp), %rsi
leaq 0x233ac(%rip), %rdi     # 0x36cb8
callq 0xe3e0
movslq -0x8(%rbp), %rax
leaq 0x23404(%rip), %rdi     # 0x36d20
imulq $0x68, %rax, %rax
addq %rax, %rdi
callq 0x19c00
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq 0x1f68a(%rip), %rax     # 0x32fc0
movq (%rax), %rdi
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0x1394b
jmp 0x13961
movq 0x1f66e(%rip), %rax     # 0x32fc0
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movl 0x20(%rax), %esi
callq 0x64c0
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x138a1
jmp 0x13973
jmp 0x13975
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x13852
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)