// File: /workspace/github_c_makefile_star2_O0/ajpaulson[P]srogue11/chase.c
// Function: do_chase
int do_chase(struct linked_list *mon)
{
	struct thing *th;
	struct room *rer, *ree, *rxx;
	int mindist, i, dist;
	struct stats *st;
	bool stoprun = FALSE, ondoor = FALSE, link = FALSE;
	unsigned long runaway, dofight, wound, sch, ch;
	struct coord this;
	struct trap *trp;

	th = THINGPTR(mon);
	wound = th->t_flags & ISWOUND;
	if (wound)
		mindist = 0;
	else
		mindist = FARAWAY;
	runaway = wound;
	dofight = !runaway;
	rer = th->t_room;
	if (th->t_type == 'V') {
		if (rer != NULL && !rf_on(rer, ISDARK)) {
			/*
			 * Vampires can't stand the light
			 */
			if (cansee(th->t_pos.y, th->t_pos.x))
				msg("The vampire vaporizes into thin air !");
			killed(mon, FALSE);
			return(-1);
		}
	}
	ree = roomin(th->t_dest);	/* room of chasee */
	this = *th->t_dest;
	/*
	 * If the object of our desire is in a different
	 * room, then run to the door nearest to our goal.
	 */
	if (mvinch(th->t_pos.y, th->t_pos.x) == DOOR)
		ondoor = TRUE;
	rxx = NULL;
	if (rer != NULL || ree != NULL) {
		/*
		 * Monster not in room, hero in room. Run to closest door
		 * in hero's room if not wounded. Run away if wounded.
		 */
		if (rer == NULL && ree != NULL) {
			if (!wound)
				rxx = ree;
		}
		/*
		 * Monster in a room, hero not in room. If on a door,
		 * then use closest distance. If not on a door, then
		 * run to closest door in monsters room.
		 */
		else if (rer != NULL && ree == NULL) {
			if (!ondoor) {
				rxx = rer;
				if (wound)
					runaway = FALSE;
			}
		}
		/*
		 * Both hero and monster in a DIFFERENT room. Set flag to
		 * check for links between the monster's and hero's rooms.
		 * If no links are found, then the closest door in the
		 * monster's room is used.
		 */
		else if (rer != ree) {
			if (!wound) {
				link = TRUE;
				if (ondoor)
					rxx = ree;	/* if on door, run to heros room */
				else
					rxx = rer;	/* else to nearest door this room */
			}
		}
		/*
		 * Both hero and monster in same room. If monster is
		 * wounded, find the best door to run to.
		 */
		else if (wound) {
			struct coord *ex;
			int poss, mdtd, hdtd, ghdtd, nx, gx = 0, best;

			best = ghdtd = -FARAWAY;
			for (nx = 0; nx < ree->r_nexits; nx++) {
				ex = &ree->r_exit[nx];
				if (mvinch(ex->y, ex->x) == SECRETDOOR)
					continue;
				gx += 1;
				mdtd = abs(th->t_pos.y - ex->y) + abs(th->t_pos.x - ex->x);
				hdtd = abs(hero.y - ex->y) + abs(hero.x - ex->x);
				poss = hdtd - mdtd;				/* possible move */
				if (poss > best) {
					best = poss;
					this = *ex;
				}
				else if (poss == best && hdtd > ghdtd) {
					ghdtd = hdtd;
					best = poss;
					this = *ex;
				}
			}
			runaway = FALSE;		/* go for target */
			if (best < 1)
				dofight = TRUE;		/* fight if we must */
			mdtd = (gx <= 1 && best < 1);
			if (ondoor || mdtd) {
				this = hero;
				runaway = TRUE;
				if (!mdtd)
					dofight = FALSE;
			}
		}
		if (rxx != NULL) {
			for (i = 0; i < rxx->r_nexits; i += 1) {
				dist = RDIST(th->t_dest, rxx->r_exit[i]);
				if (link && rxx->r_ptr[i] == ree)
					dist = -1;
				if ((!wound && dist < mindist) ||
				    (wound && dist > mindist)) {
					this = rxx->r_exit[i];
					mindist = dist;
				}
			}
		}
	}
	else if (DISTANCE(hero.y, hero.x, th->t_pos.y, th->t_pos.x) <= 3)
		dofight = TRUE;
	/*
	 * this now contains what we want to run to this time
	 * so we run to it.  If we hit it we either want to
	 * fight it or stop running.
	 */
	if (chase(th, &this, runaway, dofight) == FIGHT) {
		return( attack(th) );
	}
	else if ((th->t_flags & (ISSTUCK | ISPARA)))
		return(0);				/* if paralyzed or stuck */
	if ((trp = trap_at(ch_ret.y, ch_ret.x)) != NULL) {
		ch = be_trapped(&ch_ret, th);
		if (ch == GONER || nlmove) {
			if (ch == GONER)
				remove_monster(&th->t_pos, mon);
			nlmove = FALSE;
			return((ch == GONER) ? -1 : 0);
		}
	}
	if (pl_off(ISBLIND))
		mvwaddch(cw,th->t_pos.y,th->t_pos.x,th->t_oldch);
	sch = mvwinch(cw, ch_ret.y, ch_ret.x);
	if (rer != NULL && rf_on(rer,ISDARK) && sch == FLOOR &&
	  DISTANCE(ch_ret.y,ch_ret.x,th->t_pos.y,th->t_pos.x) < 3 &&
	  pl_off(ISBLIND))
		th->t_oldch = ' ';
	else
		th->t_oldch = sch;
	if (cansee(unc(ch_ret)) && off(*th, ISINVIS))
		mvwaddch(cw, ch_ret.y, ch_ret.x, th->t_type);
	mvwaddch(mw, th->t_pos.y, th->t_pos.x, ' ');
	mvwaddch(mw, ch_ret.y, ch_ret.x, th->t_type);
	th->t_oldpos = th->t_pos;
	th->t_pos = ch_ret;
	th->t_room = roomin(&ch_ret);
	i = 5;
	if (th->t_flags & ISREGEN)
		i = 40;
	st = &th->t_stats;
	if (rnd(100) < i) {
		if (++st->s_hpt > st->s_maxhp)
			st->s_hpt = st->s_maxhp;
		if (!monhurt(th))
			th->t_flags &= ~ISWOUND;
	}
	if (stoprun && ce(th->t_pos, *(th->t_dest)))
		th->t_flags &= ~ISRUN;
	return CHASE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movb $0x0, -0x49(%rbp)
movb $0x0, -0x4a(%rbp)
movb $0x0, -0x4b(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rax
andq $0x80, %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0x6b29
movl $0x0, -0x34(%rbp)
jmp 0x6b30
movl $0x7fff, -0x34(%rbp)    # imm = 0x7FFF
movq -0x68(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movsbl 0x8d(%rax), %eax
cmpl $0x56, %eax
jne 0x6bc3
cmpq $0x0, -0x20(%rbp)
je 0x6bc1
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x19950
cmpl $0x0, %eax
jne 0x6bc1
movq -0x18(%rbp), %rax
movl 0x54(%rax), %edi
movq -0x18(%rbp), %rax
movl 0x50(%rax), %esi
callq 0x7480
testb $0x1, %al
jne 0x6b9c
jmp 0x6baa
leaq 0x224cf(%rip), %rdi     # 0x29072
movb $0x0, %al
callq 0xd8f0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0xbaf0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x746b
jmp 0x6bc3
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rdi
callq 0x7560
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq (%rax), %rax
movq %rax, -0x80(%rbp)
movq 0x2c3d6(%rip), %rax     # 0x32fc0
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movl 0x54(%rax), %esi
movq -0x18(%rbp), %rax
movl 0x50(%rax), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0x6c12
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0xb0(%rbp)
jmp 0x6c27
movq 0x2c3a7(%rip), %rax     # 0x32fc0
movq (%rax), %rdi
callq 0x6340
movl %eax, -0xb0(%rbp)
movl -0xb0(%rbp), %eax
cmpl $0x2b, %eax
jne 0x6c36
movb $0x1, -0x4a(%rbp)
movq $0x0, -0x30(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x6c50
cmpq $0x0, -0x28(%rbp)
je 0x7029
cmpq $0x0, -0x20(%rbp)
jne 0x6c72
cmpq $0x0, -0x28(%rbp)
je 0x6c72
cmpq $0x0, -0x68(%rbp)
jne 0x6c6d
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x6f39
cmpq $0x0, -0x20(%rbp)
je 0x6ca4
cmpq $0x0, -0x28(%rbp)
jne 0x6ca4
testb $0x1, -0x4a(%rbp)
jne 0x6c9f
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0x6c9d
movq $0x0, -0x58(%rbp)
jmp 0x6c9f
jmp 0x6f37
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x6cd8
cmpq $0x0, -0x68(%rbp)
jne 0x6cd3
movb $0x1, -0x4b(%rbp)
testb $0x1, -0x4a(%rbp)
je 0x6cc9
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x6cd1
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x6cd3
jmp 0x6f35
cmpq $0x0, -0x68(%rbp)
je 0x6f33
movl $0x0, -0xa8(%rbp)
movl $0xffff8001, -0xa0(%rbp) # imm = 0xFFFF8001
movl $0xffff8001, -0xac(%rbp) # imm = 0xFFFF8001
movl $0x0, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x60(%rcx), %eax
jge 0x6ead
movq -0x28(%rbp), %rax
addq $0x18, %rax
movslq -0xa4(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq 0x2c27e(%rip), %rax     # 0x32fc0
movq (%rax), %rdi
movq -0x90(%rbp), %rax
movl 0x4(%rax), %esi
movq -0x90(%rbp), %rax
movl (%rax), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0x6d6f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0xb4(%rbp)
jmp 0x6d84
movq 0x2c24a(%rip), %rax     # 0x32fc0
movq (%rax), %rdi
callq 0x6340
movl %eax, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
cmpl $0x26, %eax
jne 0x6d94
jmp 0x6e99
movl -0xa8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa8(%rbp)
movq -0x18(%rbp), %rax
movl 0x54(%rax), %eax
movq -0x90(%rbp), %rcx
subl 0x4(%rcx), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movq -0x18(%rbp), %rcx
movl 0x50(%rcx), %ecx
movq -0x90(%rbp), %rdx
subl (%rdx), %ecx
movl %ecx, %edx
negl %edx
cmovnsl %edx, %ecx
addl %ecx, %eax
movl %eax, -0x98(%rbp)
leaq 0x302ef(%rip), %rax     # 0x370d0
movl 0x54(%rax), %eax
movq -0x90(%rbp), %rcx
subl 0x4(%rcx), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
leaq 0x302d4(%rip), %rcx     # 0x370d0
movl 0x50(%rcx), %ecx
movq -0x90(%rbp), %rdx
subl (%rdx), %ecx
movl %ecx, %edx
negl %edx
cmovnsl %edx, %ecx
addl %ecx, %eax
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
subl -0x98(%rbp), %eax
movl %eax, -0x94(%rbp)
movl -0x94(%rbp), %eax
cmpl -0xac(%rbp), %eax
jle 0x6e53
movl -0x94(%rbp), %eax
movl %eax, -0xac(%rbp)
movq -0x90(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x80(%rbp)
jmp 0x6e97
movl -0x94(%rbp), %eax
cmpl -0xac(%rbp), %eax
jne 0x6e95
movl -0x9c(%rbp), %eax
cmpl -0xa0(%rbp), %eax
jle 0x6e95
movl -0x9c(%rbp), %eax
movl %eax, -0xa0(%rbp)
movl -0x94(%rbp), %eax
movl %eax, -0xac(%rbp)
movq -0x90(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x80(%rbp)
jmp 0x6e97
jmp 0x6e99
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x6d0b
movq $0x0, -0x58(%rbp)
cmpl $0x1, -0xac(%rbp)
jge 0x6ec6
movq $0x1, -0x60(%rbp)
xorl %eax, %eax
cmpl $0x1, -0xa8(%rbp)
movb %al, -0xb5(%rbp)
jg 0x6ee7
cmpl $0x1, -0xac(%rbp)
setl %al
movb %al, -0xb5(%rbp)
movb -0xb5(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x98(%rbp)
testb $0x1, -0x4a(%rbp)
jne 0x6f07
cmpl $0x0, -0x98(%rbp)
je 0x6f31
leaq 0x301c2(%rip), %rax     # 0x370d0
movq 0x50(%rax), %rax
movq %rax, -0x80(%rbp)
movq $0x1, -0x58(%rbp)
cmpl $0x0, -0x98(%rbp)
jne 0x6f2f
movq $0x0, -0x60(%rbp)
jmp 0x6f31
jmp 0x6f33
jmp 0x6f35
jmp 0x6f37
jmp 0x6f39
cmpq $0x0, -0x30(%rbp)
je 0x7027
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x60(%rcx), %eax
jge 0x7025
movq -0x30(%rbp), %rax
movslq -0x38(%rbp), %rcx
movl 0x18(%rax,%rcx,8), %eax
movq -0x18(%rbp), %rcx
movq 0x60(%rcx), %rcx
subl (%rcx), %eax
movq -0x30(%rbp), %rcx
movslq -0x38(%rbp), %rdx
movl 0x18(%rcx,%rdx,8), %ecx
movq -0x18(%rbp), %rdx
movq 0x60(%rdx), %rdx
subl (%rdx), %ecx
imull %ecx, %eax
movq -0x30(%rbp), %rcx
movslq -0x38(%rbp), %rdx
movl 0x1c(%rcx,%rdx,8), %ecx
movq -0x18(%rbp), %rdx
movq 0x60(%rdx), %rdx
subl 0x4(%rdx), %ecx
movq -0x30(%rbp), %rdx
movslq -0x38(%rbp), %rsi
movl 0x1c(%rdx,%rsi,8), %edx
movq -0x18(%rbp), %rsi
movq 0x60(%rsi), %rsi
subl 0x4(%rsi), %edx
imull %edx, %ecx
addl %ecx, %eax
movl %eax, -0x3c(%rbp)
testb $0x1, -0x4b(%rbp)
je 0x6fe0
movq -0x30(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq 0x38(%rax,%rcx,8), %rax
cmpq -0x28(%rbp), %rax
jne 0x6fe0
movl $0xffffffff, -0x3c(%rbp) # imm = 0xFFFFFFFF
cmpq $0x0, -0x68(%rbp)
jne 0x6fef
movl -0x3c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jl 0x6ffe
cmpq $0x0, -0x68(%rbp)
je 0x7015
movl -0x3c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jle 0x7015
movq -0x30(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x80(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x7017
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x6f4b
jmp 0x7027
jmp 0x7084
movq -0x18(%rbp), %rax
movl 0x50(%rax), %eax
leaq 0x30099(%rip), %rcx     # 0x370d0
subl 0x50(%rcx), %eax
movq -0x18(%rbp), %rcx
movl 0x50(%rcx), %ecx
leaq 0x30088(%rip), %rdx     # 0x370d0
subl 0x50(%rdx), %ecx
imull %ecx, %eax
movq -0x18(%rbp), %rcx
movl 0x54(%rcx), %ecx
leaq 0x30074(%rip), %rdx     # 0x370d0
subl 0x54(%rdx), %ecx
movq -0x18(%rbp), %rdx
movl 0x54(%rdx), %edx
leaq 0x30063(%rip), %rsi     # 0x370d0
subl 0x54(%rsi), %edx
imull %edx, %ecx
addl %ecx, %eax
cmpl $0x3, %eax
jg 0x7082
movq $0x1, -0x60(%rbp)
jmp 0x7084
movq -0x18(%rbp), %rdi
cmpq $0x0, -0x58(%rbp)
setne %cl
cmpq $0x0, -0x60(%rbp)
setne %al
movzbl %cl, %edx
andl $0x1, %edx
movzbl %al, %ecx
andl $0x1, %ecx
leaq -0x80(%rbp), %rsi
callq 0x7630
cmpl $0x1, %eax
jne 0x70c3
movq -0x18(%rbp), %rdi
callq 0xbf70
movl %eax, -0x4(%rbp)
jmp 0x746b
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rax
andq $0x3, %rax
cmpq $0x0, %rax
je 0x70e1
movl $0x0, -0x4(%rbp)
jmp 0x746b
jmp 0x70e3
movl 0x2f97f(%rip), %edi     # 0x36a68
movl 0x2f975(%rip), %esi     # 0x36a64
movb $0x0, %al
callq 0x12e80
movq %rax, -0x88(%rbp)
cmpq $0x0, %rax
je 0x716c
movq -0x18(%rbp), %rsi
leaq 0x2f956(%rip), %rdi     # 0x36a64
callq 0x11b00
movsbq %al, %rax
movq %rax, -0x78(%rbp)
cmpq $0x2, -0x78(%rbp)
je 0x712e
leaq 0x2fbe0(%rip), %rax     # 0x36d09
testb $0x1, (%rax)
je 0x716a
cmpq $0x2, -0x78(%rbp)
jne 0x7146
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
movq -0x10(%rbp), %rsi
callq 0xcac0
leaq 0x2fbbc(%rip), %rax     # 0x36d09
movb $0x0, (%rax)
movq -0x78(%rbp), %rdx
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq $0x2, %rdx
cmovel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x746b
jmp 0x716c
movl $0x1, %edi
callq 0xaa90
testb $0x1, %al
jne 0x717c
jmp 0x71ba
leaq 0x32ccd(%rip), %rax     # 0x39e50
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movl 0x54(%rax), %esi
movq -0x18(%rbp), %rax
movl 0x50(%rax), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0x71a0
jmp 0x71ba
leaq 0x32ca9(%rip), %rax     # 0x39e50
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movsbl 0x8f(%rax), %esi
callq 0x64c0
leaq 0x32c8f(%rip), %rax     # 0x39e50
movq (%rax), %rdi
movl 0x2f89e(%rip), %esi     # 0x36a68
movl 0x2f894(%rip), %edx     # 0x36a64
callq 0x6490
cmpl $-0x1, %eax
jne 0x71e7
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0xbc(%rbp)
jmp 0x71fc
leaq 0x32c62(%rip), %rax     # 0x39e50
movq (%rax), %rdi
callq 0x6340
movl %eax, -0xbc(%rbp)
movl -0xbc(%rbp), %eax
movl %eax, %eax
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x7287
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x19950
cmpl $0x0, %eax
je 0x7287
cmpq $0x2e, -0x70(%rbp)
jne 0x7287
movq -0x18(%rbp), %rax
movl 0x50(%rax), %eax
subl 0x2f82e(%rip), %eax     # 0x36a64
movq -0x18(%rbp), %rcx
movl 0x50(%rcx), %ecx
subl 0x2f821(%rip), %ecx     # 0x36a64
imull %ecx, %eax
movq -0x18(%rbp), %rcx
movl 0x54(%rcx), %ecx
subl 0x2f815(%rip), %ecx     # 0x36a68
movq -0x18(%rbp), %rdx
movl 0x54(%rdx), %edx
subl 0x2f808(%rip), %edx     # 0x36a68
imull %edx, %ecx
addl %ecx, %eax
cmpl $0x3, %eax
jge 0x7287
movl $0x1, %edi
callq 0xaa90
testb $0x1, %al
jne 0x727a
jmp 0x7287
movq -0x18(%rbp), %rax
movb $0x20, 0x8f(%rax)
jmp 0x7297
movq -0x70(%rbp), %rax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x8f(%rax)
movl 0x2f7cb(%rip), %edi     # 0x36a68
movl 0x2f7c1(%rip), %esi     # 0x36a64
callq 0x7480
testb $0x1, %al
jne 0x72ae
jmp 0x72fc
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rax
andq $0x10, %rax
cmpq $0x0, %rax
jne 0x72fc
leaq 0x32b89(%rip), %rax     # 0x39e50
movq (%rax), %rdi
movl 0x2f798(%rip), %esi     # 0x36a68
movl 0x2f78e(%rip), %edx     # 0x36a64
callq 0x6490
cmpl $-0x1, %eax
jne 0x72e2
jmp 0x72fc
leaq 0x32b67(%rip), %rax     # 0x39e50
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movsbl 0x8d(%rax), %esi
callq 0x64c0
leaq 0x32b5d(%rip), %rax     # 0x39e60
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movl 0x54(%rax), %esi
movq -0x18(%rbp), %rax
movl 0x50(%rax), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0x7320
jmp 0x7334
leaq 0x32b39(%rip), %rax     # 0x39e60
movq (%rax), %rdi
movl $0x20, %esi
callq 0x64c0
leaq 0x32b25(%rip), %rax     # 0x39e60
movq (%rax), %rdi
movl 0x2f724(%rip), %esi     # 0x36a68
movl 0x2f71a(%rip), %edx     # 0x36a64
callq 0x6490
cmpl $-0x1, %eax
jne 0x7356
jmp 0x7370
leaq 0x32b03(%rip), %rax     # 0x39e60
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movsbl 0x8d(%rax), %esi
callq 0x64c0
movq -0x18(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x50(%rcx), %rcx
movq %rcx, 0x58(%rax)
movq -0x18(%rbp), %rax
movq 0x2f6d9(%rip), %rcx     # 0x36a64
movq %rcx, 0x50(%rax)
leaq 0x2f6ce(%rip), %rdi     # 0x36a64
callq 0x7560
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x70(%rax)
movl $0x5, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rax
andq $0x400, %rax            # imm = 0x400
cmpq $0x0, %rax
je 0x73c8
movl $0x28, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x64, %edi
movb $0x0, %al
callq 0xef20
cmpl -0x38(%rbp), %eax
jge 0x7427
movq -0x48(%rbp), %rcx
movl 0x30(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x30(%rcx)
movq -0x48(%rbp), %rcx
cmpl 0x34(%rcx), %eax
jle 0x7405
movq -0x48(%rbp), %rax
movl 0x34(%rax), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x18(%rbp), %rdi
callq 0x10f90
testb $0x1, %al
jne 0x7425
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rcx
andq $-0x81, %rcx
movq %rcx, 0x78(%rax)
jmp 0x7427
testb $0x1, -0x49(%rbp)
je 0x7464
movq -0x18(%rbp), %rax
movl 0x50(%rax), %eax
movq -0x18(%rbp), %rcx
movq 0x60(%rcx), %rcx
cmpl (%rcx), %eax
jne 0x7464
movq -0x18(%rbp), %rax
movl 0x54(%rax), %eax
movq -0x18(%rbp), %rcx
movq 0x60(%rcx), %rcx
cmpl 0x4(%rcx), %eax
jne 0x7464
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rcx
andq $-0x5, %rcx
movq %rcx, 0x78(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw (%rax,%rax)