// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: PutClientInServer
void PutClientInServer (edict_t *ent)
{
	trace_t		tr; // CTF CODE -- LM_JORM
	
	vec3_t mins = {-16, -16, -24};
	vec3_t maxs = {16, 16, 32};
	int 	index;
	vec3_t spawn_origin;
	vec3_t spawn_angles;
	gclient_t *client;
	int 	i;
 	client_persistent_t	saved;
	client_respawn_t	resp;
	stats_player_s *p_saved_stats = NULL; // STATS - LM_Hati

	static unsigned long unique_id = 6; //guaranteed 0-5 are special
	
	// find a spawn point
	// do it before setting health back up, so farthest
	// ranging doesn't count this client
	SelectSpawnPoint (ent, spawn_origin, spawn_angles);

	index = ent-g_edicts-1;
	client = ent->client;

	// deathmatch wipes most client data every spawn
	if (deathmatch->value)
	{
		char		userinfo[MAX_INFO_STRING];
		char savedsquad [MAX_CATEGORY_LEN]; // ADC
	
		resp = client->resp;
		memcpy (userinfo, client->pers.userinfo, sizeof(userinfo));

		// We don't want to lose the squad so save it
		// off here first, then copy it back. The unitstatus
		// will be set to "respawned" elsewhere.

		strncpy (savedsquad, ent->client->pers.squad, sizeof savedsquad); // ADC
		savedsquad[MAX_CATEGORY_LEN-1] = 0; // ADC

		InitClientPersistent (client);
		ClientUserinfoChanged (ent, userinfo);

		strncpy (ent->client->pers.squad, savedsquad, MAX_CATEGORY_LEN); // ADC
		ent->client->pers.squad[MAX_CATEGORY_LEN-1] = 0; // ADC
	}
	else if (coop->value)
	{
//		int			n;
		char		userinfo[MAX_INFO_STRING];

		resp = client->resp;
		memcpy (userinfo, client->pers.userinfo, sizeof(userinfo));
		// this is kind of ugly, but it's how we want to handle keys in coop
//		for (n = 0; n < game.num_items; n++)
//		{
//			if (itemlist[n].flags & IT_KEY)
//				resp.coop_respawn.inventory[n] = client->pers.inventory[n];
//		}
		resp.coop_respawn.game_helpchanged = client->pers.game_helpchanged;
		resp.coop_respawn.helpchanged = client->pers.helpchanged;
		client->pers = resp.coop_respawn;
		ClientUserinfoChanged (ent, userinfo);
		if (resp.score > client->pers.score)
			client->pers.score = resp.score;
	}
	else
	{
		memset (&resp, 0, sizeof(resp));
	}
	

	p_saved_stats = ent->client->p_stats_player;
	ctftemp = client->ctf; //surt never overwrite

	saved = client->pers;
	memset (client, 0, sizeof(*client));
	client->pers = saved;

	
	if(client->pers.health <= 0)
		InitClientPersistent(client);
	
	client->resp = resp;

	// copy some data from the client to the entity
	FetchClientEntData (ent);

	// clear entity values
	ent->groundentity = NULL;
	ent->client = &game.clients[index];
	ent->takedamage = DAMAGE_AIM;
	ent->movetype = MOVETYPE_WALK;
	ent->viewheight = 22;
	ent->inuse = true;
	ent->classname = "player";
	ent->mass = 200;
	ent->solid = SOLID_BBOX;
	ent->deadflag = DEAD_NO;
	ent->air_finished = level.time + 12;
	ent->clipmask = MASK_PLAYERSOLID;
	ent->model = "players/male/tris.md2";
	ent->pain = player_pain;
	ent->die = player_die;
	ent->waterlevel = 0;
	ent->watertype = 0;
	ent->flags &= ~FL_NO_KNOCKBACK;
	ent->svflags &= ~SVF_DEADMONSTER;

	VectorCopy (mins, ent->mins);
	VectorCopy (maxs, ent->maxs);
	VectorClear (ent->velocity);

	// clear playerstate values
	memset (&ent->client->ps, 0, sizeof(client->ps));

	client->ps.pmove.origin[0] = spawn_origin[0]*8;
	client->ps.pmove.origin[1] = spawn_origin[1]*8;
	client->ps.pmove.origin[2] = spawn_origin[2]*8;

	if (deathmatch->value && ((int)dmflags->value & DF_FIXED_FOV))
	{
		client->ps.fov = 90;
	}
	else
	{
		client->ps.fov = atoi(Info_ValueForKey(client->pers.userinfo, "fov"));
		if (client->ps.fov < 1)
			client->ps.fov = 90;
		else if (client->ps.fov > 160)
			client->ps.fov = 160;
	}

	client->ps.gunindex = gi.modelindex(client->pers.weapon->view_model);

	// clear entity state values
	ent->s.effects = 0;
	ent->s.modelindex = 255;		// will use the skin specified model
	ent->s.modelindex2 = 255;		// custom gun model
	// sknum is player num and weapon number
	// weapon number will be added in changeweapon
	ent->s.skinnum = ent - g_edicts - 1;

	ent->s.frame = 0;
	VectorCopy (spawn_origin, ent->s.origin);
	ent->s.origin[2] += 1;	// make sure off ground
	VectorCopy (ent->s.origin, ent->s.old_origin);

	// set the delta angle
	for (i=0 ; i<3 ; i++)
	{
		client->ps.pmove.delta_angles[i] = ANGLE2SHORT(spawn_angles[i] - client->resp.cmd_angles[i]);
	}

	ent->s.angles[PITCH] = 0;
	ent->s.angles[YAW] = spawn_angles[YAW];
	ent->s.angles[ROLL] = 0;
	VectorCopy (ent->s.angles, client->ps.viewangles);
	VectorCopy (ent->s.angles, client->v_angle);

	
	// spawn a spectator
	if(client->pers.spectator) {
		client->chase_target = NULL;

		client->resp.spectator = true;

		ent->movetype = MOVETYPE_NOCLIP;
		ent->solid = SOLID_NOT;
		ent->svflags |= SVF_NOCLIENT;
		ent->client->ps.gunindex = 0;
		gi.linkentity (ent);
		//Don't return here!  I still want to save everything!
		//-bat
		//return;
	} else
		client->resp.spectator = false;
	

	if (!KillBox (ent))
	{	// couldn't spawn in?
		
		// CTF CODE -- LM_JORM
		// If we failed Killbox, maybe it was because we are on a teammate.  Kill them anyway
		while (1)
		{
			tr = gi.trace (ent->s.origin, ent->mins, ent->maxs, ent->s.origin, NULL, MASK_PLAYERSOLID);
			if (!tr.ent)
				break;
			
			// FIXME -- This will make it look like a suicide
			T_Damage (tr.ent, tr.ent, tr.ent, vec3_origin, ent->s.origin, vec3_origin, 100000, 0, DAMAGE_NO_PROTECTION, MOD_TELEFRAG);
			
			// If we still didn't kill it, stop
			if (tr.ent->solid)
				break;
			
		}
		// END CTF CODE -- LM_JORM
	}


	gi.linkentity (ent);

	client->p_stats_player = p_saved_stats; // STATS - LM_Hati
	client->ctf = ctftemp; //surt restore

	client->ctf.ctfid = unique_id++;
	client->showctfhud = true; // LM_JORM -- Turn on CTF HUD
	client->ctf.extra_flags |= CTF_EXTRAFLAGS_RADIO_SOUND; // LM_JORM -- Turn on our radio
	
	// force the current weapon up
	client->newweapon = client->pers.weapon;
	ChangeWeapon (ent);

	//sprintf(DBuffer, "pcis-z t %d p %d r %d", ent->client->ctf.teamnum,
	//	ent->client->pers.spectator, ent->client->resp.spectator);
	//Debug_Show(DBuffer);


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1290, %rsp           # imm = 0x1290
movq %rdi, -0x8(%rbp)
movq 0x1cc66(%rip), %rax     # 0x765cc
movq %rax, -0x5c(%rbp)
movl 0x1cc64(%rip), %eax     # 0x765d4
movl %eax, -0x54(%rbp)
movq 0x1cc5e(%rip), %rax     # 0x765d8
movq %rax, -0x68(%rbp)
movl 0x1cc5c(%rip), %eax     # 0x765e0
movl %eax, -0x60(%rbp)
movq $0x0, -0xde8(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0x84(%rbp), %rdx
callq 0x19620
movq -0x8(%rbp), %rax
movq 0x28ba7(%rip), %rcx     # 0x82558
movq (%rcx), %rcx
subq %rcx, %rax
movl $0x4a8, %ecx            # imm = 0x4A8
cqto
idivq %rcx
subq $0x1, %rax
movl %eax, -0x6c(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x90(%rbp)
movq 0x294e2(%rip), %rax     # 0x82ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x599f5
jp 0x599f5
jmp 0x59ab8
movq -0x90(%rbp), %rsi
addq $0x758, %rsi            # imm = 0x758
leaq -0xde0(%rbp), %rdi
movl $0x6b0, %edx            # imm = 0x6B0
callq 0x18dc0
leaq -0xff0(%rbp), %rdi
movq -0x90(%rbp), %rsi
addq $0xc0, %rsi
movl $0x200, %edx            # imm = 0x200
callq 0x18dc0
leaq -0x1000(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rsi
addq $0xc0, %rsi
addq $0x210, %rsi            # imm = 0x210
movl $0x10, %edx
callq 0x181e0
movb $0x0, -0xff1(%rbp)
movq -0x90(%rbp), %rdi
callq 0x19b80
movq -0x8(%rbp), %rdi
leaq -0xff0(%rbp), %rsi
callq 0x19d18
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdi
addq $0xc0, %rdi
addq $0x210, %rdi            # imm = 0x210
leaq -0x1000(%rbp), %rsi
movl $0x10, %edx
callq 0x181e0
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movb $0x0, 0x2df(%rax)
jmp 0x59ba8
movq 0x294a1(%rip), %rax     # 0x82f60
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x59ad6
jp 0x59ad6
jmp 0x59b93
movq -0x90(%rbp), %rsi
addq $0x758, %rsi            # imm = 0x758
leaq -0xde0(%rbp), %rdi
movl $0x6b0, %edx            # imm = 0x6B0
callq 0x18dc0
leaq -0x1200(%rbp), %rdi
movq -0x90(%rbp), %rsi
addq $0xc0, %rsi
movl $0x200, %edx            # imm = 0x200
callq 0x18dc0
movq -0x90(%rbp), %rax
movl 0x748(%rax), %eax
movl %eax, -0x758(%rbp)
movq -0x90(%rbp), %rax
movl 0x74c(%rax), %eax
movl %eax, -0x754(%rbp)
movq -0x90(%rbp), %rdi
addq $0xc0, %rdi
leaq -0xde0(%rbp), %rsi
movl $0x698, %edx            # imm = 0x698
callq 0x18dc0
movq -0x8(%rbp), %rdi
leaq -0x1200(%rbp), %rsi
callq 0x19d18
movl -0x744(%rbp), %eax
movq -0x90(%rbp), %rcx
cmpl 0x744(%rcx), %eax
jle 0x59b91
movl -0x744(%rbp), %ecx
movq -0x90(%rbp), %rax
movl %ecx, 0x744(%rax)
jmp 0x59ba6
leaq -0xde0(%rbp), %rdi
xorl %esi, %esi
movl $0x6b0, %edx            # imm = 0x6B0
callq 0x188f0
jmp 0x59ba8
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x9138(%rax), %rax
movq %rax, -0xde8(%rbp)
movq -0x90(%rbp), %rsi
addq $0x1100, %rsi           # imm = 0x1100
leaq 0x515a5(%rip), %rdi     # 0xab178
movl $0x8038, %edx           # imm = 0x8038
callq 0x18dc0
movq -0x90(%rbp), %rsi
addq $0xc0, %rsi
leaq -0x730(%rbp), %rdi
movl $0x698, %edx            # imm = 0x698
callq 0x18dc0
movq -0x90(%rbp), %rdi
xorl %esi, %esi
movl $0x9140, %edx           # imm = 0x9140
callq 0x188f0
movq -0x90(%rbp), %rdi
addq $0xc0, %rdi
leaq -0x730(%rbp), %rsi
movl $0x698, %edx            # imm = 0x698
callq 0x18dc0
movq -0x90(%rbp), %rax
cmpl $0x0, 0x308(%rax)
jg 0x59c4a
movq -0x90(%rbp), %rdi
callq 0x19b80
movq -0x90(%rbp), %rdi
addq $0x758, %rdi            # imm = 0x758
leaq -0xde0(%rbp), %rsi
movl $0x6b0, %edx            # imm = 0x6B0
callq 0x18dc0
movq -0x8(%rbp), %rdi
callq 0x19600
movq -0x8(%rbp), %rax
movq $0x0, 0x2b8(%rax)
movq 0x290b8(%rip), %rax     # 0x82d40
movq 0x408(%rax), %rcx
movslq -0x6c(%rbp), %rax
imulq $0x9140, %rax, %rax     # imm = 0x9140
addq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x8(%rbp), %rax
movl $0x2, 0x27c(%rax)
movq -0x8(%rbp), %rax
movl $0x4, 0x118(%rax)
movq -0x8(%rbp), %rax
movl $0x16, 0x278(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x60(%rax)
movq -0x8(%rbp), %rax
leaq 0x176b2(%rip), %rcx     # 0x71397
movq %rcx, 0x138(%rax)
movq -0x8(%rbp), %rax
movl $0xc8, 0x1d8(%rax)
movq -0x8(%rbp), %rax
movl $0x2, 0x108(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x260(%rax)
movq 0x29083(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
movss 0x161ca(%rip), %xmm1    # 0x6fef4
addss %xmm1, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x1dc(%rax)
movq -0x8(%rbp), %rax
movl $0x2010003, 0x10c(%rax) # imm = 0x2010003
movq -0x8(%rbp), %rax
leaq 0x1d3e1(%rip), %rcx     # 0x77134
movq %rcx, 0x120(%rax)
movq -0x8(%rbp), %rax
movq 0x289b3(%rip), %rcx     # 0x82718
movq %rcx, 0x230(%rax)
movq -0x8(%rbp), %rax
movq 0x28a49(%rip), %rcx     # 0x827c0
movq %rcx, 0x238(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x30c(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x308(%rax)
movq -0x8(%rbp), %rax
movl 0x11c(%rax), %ecx
andl $0xfffff7ff, %ecx       # imm = 0xFFFFF7FF
movl %ecx, 0x11c(%rax)
movq -0x8(%rbp), %rax
movl 0xc8(%rax), %ecx
andl $-0x3, %ecx
movl %ecx, 0xc8(%rax)
movss -0x5c(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0xcc(%rax)
movss -0x58(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0xd0(%rax)
movss -0x54(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0xd4(%rax)
movss -0x68(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0xd8(%rax)
movss -0x64(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0xdc(%rax)
movss -0x60(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0xe0(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x1c8(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x1c4(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x1c0(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x1268(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x1260(%rbp)
movups %xmm0, 0xa0(%rax)
movups %xmm0, 0x90(%rax)
movups %xmm0, 0x80(%rax)
movups %xmm0, 0x70(%rax)
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0xb0(%rax)
movss -0x78(%rbp), %xmm0
movss 0x16044(%rip), %xmm1    # 0x6fefc
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movw %ax, %cx
movq -0x90(%rbp), %rax
movw %cx, 0x4(%rax)
movss -0x74(%rbp), %xmm0
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movw %ax, %cx
movq -0x90(%rbp), %rax
movw %cx, 0x6(%rax)
movss -0x70(%rbp), %xmm0
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movw %ax, %cx
movq -0x90(%rbp), %rax
movw %cx, 0x8(%rax)
movq 0x28fb5(%rip), %rax     # 0x82ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x59f1f
jp 0x59f1f
jmp 0x59f51
movq 0x286f2(%rip), %rax     # 0x82618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
je 0x59f51
movq -0x90(%rbp), %rax
movss 0x174dd(%rip), %xmm0    # 0x71424
movss %xmm0, 0x70(%rax)
jmp 0x59fdf
movq -0x90(%rbp), %rdi
addq $0xc0, %rdi
leaq 0x18b23(%rip), %rsi     # 0x72a89
callq 0x18cb0
movq %rax, %rdi
callq 0x19820
cvtsi2ss %eax, %xmm0
movq -0x90(%rbp), %rax
movss %xmm0, 0x70(%rax)
movq -0x90(%rbp), %rax
movss 0x15f5a(%rip), %xmm0    # 0x6feec
ucomiss 0x70(%rax), %xmm0
jbe 0x59fae
movq -0x90(%rbp), %rax
movss 0x1747d(%rip), %xmm0    # 0x71424
movss %xmm0, 0x70(%rax)
jmp 0x59fdd
movq -0x90(%rbp), %rax
movss 0x70(%rax), %xmm0
movss 0x1745e(%rip), %xmm1    # 0x71420
ucomiss %xmm1, %xmm0
jbe 0x59fdb
movq -0x90(%rbp), %rax
movss 0x1744a(%rip), %xmm0    # 0x71420
movss %xmm0, 0x70(%rax)
jmp 0x59fdd
jmp 0x59fdf
movq 0x2861a(%rip), %rax     # 0x82600
movq 0x40(%rax), %rax
movq -0x90(%rbp), %rcx
movq 0x730(%rcx), %rcx
movq 0x40(%rcx), %rdi
callq *%rax
movl %eax, %ecx
movq -0x90(%rbp), %rax
movl %ecx, 0x58(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x40(%rax)
movq -0x8(%rbp), %rax
movl $0xff, 0x28(%rax)
movq -0x8(%rbp), %rax
movl $0xff, 0x2c(%rax)
movq -0x8(%rbp), %rax
movq 0x28522(%rip), %rcx     # 0x82558
movq (%rcx), %rcx
subq %rcx, %rax
movl $0x4a8, %ecx            # imm = 0x4A8
cqto
idivq %rcx
subq $0x1, %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x3c(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x38(%rax)
movss -0x78(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x4(%rax)
movss -0x74(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x8(%rax)
movss -0x70(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0xc(%rax)
movq -0x8(%rbp), %rax
movss 0x15e58(%rip), %xmm0    # 0x6feec
addss 0xc(%rax), %xmm0
movss %xmm0, 0xc(%rax)
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x1c(%rax)
movq -0x8(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x20(%rax)
movq -0x8(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x24(%rax)
movl $0x0, -0x94(%rbp)
cmpl $0x3, -0x94(%rbp)
jge 0x5a156
movslq -0x94(%rbp), %rax
movss -0x84(%rbp,%rax,4), %xmm0
movq -0x90(%rbp), %rax
movslq -0x94(%rbp), %rcx
subss 0xdf8(%rax,%rcx,4), %xmm0
movss 0x16c12(%rip), %xmm1    # 0x70d28
mulss %xmm1, %xmm0
movss 0x16c02(%rip), %xmm1    # 0x70d24
divss %xmm1, %xmm0
cvttss2si %xmm0, %eax
andl $0xffff, %eax           # imm = 0xFFFF
movw %ax, %dx
movq -0x90(%rbp), %rax
movslq -0x94(%rbp), %rcx
movw %dx, 0x14(%rax,%rcx,2)
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x5a0de
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x10(%rax)
movss -0x80(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x14(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x18(%rax)
movq -0x8(%rbp), %rax
movss 0x10(%rax), %xmm0
movq -0x90(%rbp), %rax
movss %xmm0, 0x1c(%rax)
movq -0x8(%rbp), %rax
movss 0x14(%rax), %xmm0
movq -0x90(%rbp), %rax
movss %xmm0, 0x20(%rax)
movq -0x8(%rbp), %rax
movss 0x18(%rax), %xmm0
movq -0x90(%rbp), %rax
movss %xmm0, 0x24(%rax)
movq -0x8(%rbp), %rax
movss 0x10(%rax), %xmm0
movq -0x90(%rbp), %rax
movss %xmm0, 0xebc(%rax)
movq -0x8(%rbp), %rax
movss 0x14(%rax), %xmm0
movq -0x90(%rbp), %rax
movss %xmm0, 0xec0(%rax)
movq -0x8(%rbp), %rax
movss 0x18(%rax), %xmm0
movq -0x90(%rbp), %rax
movss %xmm0, 0xec4(%rax)
movq -0x90(%rbp), %rax
cmpl $0x0, 0x750(%rax)
je 0x5a28a
movq -0x90(%rbp), %rax
movq $0x0, 0xf30(%rax)
movq -0x90(%rbp), %rax
movl $0x1, 0xe04(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x118(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x108(%rax)
movq -0x8(%rbp), %rax
movl 0xc8(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0xc8(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x0, 0x58(%rax)
movq 0x28385(%rip), %rax     # 0x82600
movq 0x90(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
jmp 0x5a29b
movq -0x90(%rbp), %rax
movl $0x0, 0xe04(%rax)
movq -0x8(%rbp), %rdi
callq 0x18b60
cmpl $0x0, %eax
jne 0x5a36b
jmp 0x5a2af
movq 0x2834a(%rip), %rax     # 0x82600
movq 0x60(%rax), %rax
movq -0x8(%rbp), %rsi
addq $0x4, %rsi
movq -0x8(%rbp), %rdx
addq $0xcc, %rdx
movq -0x8(%rbp), %rcx
addq $0xd8, %rcx
movq -0x8(%rbp), %r8
addq $0x4, %r8
leaq -0x1248(%rbp), %rdi
xorl %r9d, %r9d
movl $0x2010003, (%rsp)      # imm = 0x2010003
callq *%rax
leaq -0x50(%rbp), %rdi
leaq -0x1248(%rbp), %rsi
movl $0x48, %edx
callq 0x18dc0
cmpq $0x0, -0x10(%rbp)
jne 0x5a311
jmp 0x5a369
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %r8
addq $0x4, %r8
movq 0x2843c(%rip), %r9      # 0x82768
xorl %eax, %eax
movq %r9, %rcx
movl $0x186a0, (%rsp)        # imm = 0x186A0
movl $0x0, 0x8(%rsp)
movl $0x20, 0x10(%rsp)
movl $0x15, 0x18(%rsp)
callq 0x192c0
movq -0x10(%rbp), %rax
cmpl $0x0, 0x108(%rax)
je 0x5a364
jmp 0x5a369
jmp 0x5a2af
jmp 0x5a36b
movq 0x2828e(%rip), %rax     # 0x82600
movq 0x90(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
movq -0xde8(%rbp), %rcx
movq -0x90(%rbp), %rax
movq %rcx, 0x9138(%rax)
movq -0x90(%rbp), %rdi
addq $0x1100, %rdi           # imm = 0x1100
leaq 0x50dcf(%rip), %rsi     # 0xab178
movl $0x8038, %edx           # imm = 0x8038
callq 0x18dc0
movq 0x2dc26(%rip), %rcx     # 0x87fe0
movq %rcx, %rax
addq $0x1, %rax
movq %rax, 0x2dc18(%rip)     # 0x87fe0
movq -0x90(%rbp), %rax
movq %rcx, 0x9120(%rax)
movq -0x90(%rbp), %rax
movl $0x1, 0xf78(%rax)
movq -0x90(%rbp), %rax
movl 0x1108(%rax), %ecx
orl $0x20, %ecx
movl %ecx, 0x1108(%rax)
movq -0x90(%rbp), %rax
movq 0x730(%rax), %rcx
movq -0x90(%rbp), %rax
movq %rcx, 0xe50(%rax)
movq -0x8(%rbp), %rdi
callq 0x18820
addq $0x1290, %rsp           # imm = 0x1290
popq %rbp
retq
nopl (%rax,%rax)