// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/trader.c
// Function: do_post
void do_post()
{
	struct coord tp;
	int i;
	struct room *rp;
	struct object *op;
	struct linked_list *ll;

	free_list(lvl_obj);		/* throw old items away */

	for (rp = rooms; rp < &rooms[MAXROOMS]; rp++) {
		rp->r_goldval = 0;			/* no gold */
		rp->r_nexits = 0;			/* no exits */
		rp->r_flags = ISGONE;		/* kill all rooms */
	}
	rp = &rooms[0];					/* point to only room */
	rp->r_flags = 0;				/* this room NOT gone */
	rp->r_max.x = 40;
	rp->r_max.y = 10;				/* 10 * 40 room */
	rp->r_pos.x = (COLS - rp->r_max.x) / 2;	/* center horizontal */
	rp->r_pos.y = 1;				/* 2nd line */
	draw_room(rp);					/* draw the only room */
	i = roll(4,10);					/* 10 to 40 items */
	for (; i > 0 ; i--) {			/* place all the items */
		ll = new_thing(FALSE, ANYTHING);		/* get something */
		attach(lvl_obj, ll);
		op = OBJPTR(ll);
		setoflg(op, ISPOST);		/* object in trading post */
		tp = *rnd_pos(rp);
		op->o_pos = tp;
		mvaddch(tp.y,tp.x,op->o_type);
	}
	trader = 0;
	wmove(cw,12,0);
	waddstr(cw,"Welcome to Friendly Fiend's Flea Market\n\r");
	waddstr(cw,"=======================================\n\r");
	waddstr(cw,"$: Prices object that you stand upon.\n\r");
	waddstr(cw,"#: Buys the object that you stand upon.\n\r");
	waddstr(cw,"%: Trades in something in your pack for gold.\n\r");
	trans_line();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x138ae(%rip), %rdi     # 0x2d838
callq 0xb83c
xorl %eax, %eax
leaq 0x13908(%rip), %rbx     # 0x2d8a0
movabsq $0x200000000, %rcx      # imm = 0x200000000
cmpq $0x3a7, %rax            # imm = 0x3A7
ja 0x19fba
movq %rcx, 0x58(%rbx,%rax)
andl $0x0, 0x60(%rbx,%rax)
addq $0x68, %rax
jmp 0x19fa2
andl $0x0, 0x5c(%rbx)
movl $0xa, 0xc(%rbx)
movq 0xffd4(%rip), %rax      # 0x29fa0
movl (%rax), %eax
addl $-0x28, %eax
pushq $0x2
popq %rcx
cltd
idivl %ecx
movl %eax, (%rbx)
movabsq $0x2800000001, %rax     # imm = 0x2800000001
movq %rax, 0x4(%rbx)
movq %rbx, %rdi
callq 0x12f57
pushq $0x4
popq %rdi
pushq $0xa
popq %rsi
callq 0xc025
movl %eax, %ebp
pushq $-0x1
popq %r14
pushq $0x4
popq %r12
movq 0xff2d(%rip), %r15      # 0x29f38
testl %ebp, %ebp
jle 0x1a06f
xorl %edi, %edi
movl %r14d, %esi
movl %r14d, %edx
callq 0x19c8f
movq %rax, %r13
leaq 0x13812(%rip), %rdi     # 0x2d838
movq %rax, %rsi
callq 0xb81b
movq 0x10(%r13), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x936c
movq %rbx, %rdi
callq 0x1310e
movl (%rax), %edx
movl 0x4(%rax), %esi
movl %edx, (%r13)
movl %esi, 0x4(%r13)
movq (%r15), %rdi
callq 0x6470
cmpl $-0x1, %eax
je 0x1a06b
movq (%r15), %rdi
movl 0x20(%r13), %esi
callq 0x64a0
decl %ebp
jmp 0x1a00b
leaq 0x137e2(%rip), %rax     # 0x2d858
andl $0x0, (%rax)
leaq 0x16950(%rip), %r14     # 0x309d0
movq (%r14), %rdi
pushq $0xc
popq %rsi
xorl %edx, %edx
callq 0x6470
movq (%r14), %rdi
leaq 0x7613(%rip), %rsi      # 0x216aa
pushq $-0x1
popq %rbx
movl %ebx, %edx
callq 0x6530
movq (%r14), %rdi
leaq 0x7629(%rip), %rsi      # 0x216d4
movl %ebx, %edx
callq 0x6530
movq (%r14), %rdi
leaq 0x7642(%rip), %rsi      # 0x216fe
movl %ebx, %edx
callq 0x6530
movq (%r14), %rdi
leaq 0x7659(%rip), %rsi      # 0x21726
movl %ebx, %edx
callq 0x6530
movq (%r14), %rdi
leaq 0x7672(%rip), %rsi      # 0x21750
movl %ebx, %edx
callq 0x6530
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1a5a3