// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x12739(%rip), %rdi     # 0x36cb8
callq 0xe450
leaq 0x12795(%rip), %rax     # 0x36d20
movq %rax, -0x18(%rbp)
leaq 0x1278a(%rip), %rax     # 0x36d20
addq $0x3a8, %rax            # imm = 0x3A8
cmpq %rax, -0x18(%rbp)
jae 0x245d1
movq -0x18(%rbp), %rax
movl $0x0, 0x58(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x60(%rax)
movq -0x18(%rbp), %rax
movl $0x2, 0x5c(%rax)
movq -0x18(%rbp), %rax
addq $0x68, %rax
movq %rax, -0x18(%rbp)
jmp 0x2458f
leaq 0x12748(%rip), %rax     # 0x36d20
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl $0x0, 0x5c(%rax)
movq -0x18(%rbp), %rax
movl $0x28, 0x8(%rax)
movq -0x18(%rbp), %rax
movl $0xa, 0xc(%rax)
movq 0xe9d4(%rip), %rax      # 0x32fd8
movl (%rax), %eax
movq -0x18(%rbp), %rcx
subl 0x8(%rcx), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movl $0x1, 0x4(%rax)
movq -0x18(%rbp), %rdi
callq 0x19970
movl $0x4, %edi
movl $0xa, %esi
callq 0xef70
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jle 0x246e4
xorl %edi, %edi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %edx, %esi
callq 0x24020
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rsi
leaq 0x1264e(%rip), %rdi     # 0x36cb8
callq 0xe3e0
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movl $0x4, %esi
callq 0xab50
movq -0x18(%rbp), %rdi
callq 0x19c00
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movq %rcx, (%rax)
movq 0xe915(%rip), %rax      # 0x32fc0
movq (%rax), %rdi
movl -0x4(%rbp), %esi
movl -0x8(%rbp), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0x246c0
jmp 0x246d6
movq 0xe8f9(%rip), %rax      # 0x32fc0
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movl 0x20(%rax), %esi
callq 0x64c0
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x24643
leaq 0x125ed(%rip), %rax     # 0x36cd8
movl $0x0, (%rax)
leaq 0x15758(%rip), %rax     # 0x39e50
movq (%rax), %rdi
movl $0xc, %esi
xorl %edx, %edx
callq 0x6490
leaq 0x15742(%rip), %rax     # 0x39e50
movq (%rax), %rdi
leaq 0x97cc(%rip), %rsi      # 0x2dee4
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6560
leaq 0x15727(%rip), %rax     # 0x39e50
movq (%rax), %rdi
leaq 0x97db(%rip), %rsi      # 0x2df0e
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6560
leaq 0x1570c(%rip), %rax     # 0x39e50
movq (%rax), %rdi
leaq 0x97ea(%rip), %rsi      # 0x2df38
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6560
leaq 0x156f1(%rip), %rax     # 0x39e50
movq (%rax), %rdi
leaq 0x97f7(%rip), %rsi      # 0x2df60
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6560
leaq 0x156d6(%rip), %rax     # 0x39e50
movq (%rax), %rdi
leaq 0x9806(%rip), %rsi      # 0x2df8a
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6560
callq 0x24e80
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)