// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: ClientUserinfoChanged
void ClientUserinfoChanged (edict_t *ent, char *userinfo)
{
	char	*s, *skin;
	int 	playernum;
	
	// check for malformed or illegal info strings
	if (!Info_Validate(userinfo))
	{
		strcpy (userinfo, "\\name\\badinfo\\skin\\male/grunt");
	}

	// set name
	s = Info_ValueForKey (userinfo, "name");
	strncpy (ent->client->pers.netname, s, sizeof(ent->client->pers.netname)-1);
	stats_set_name(ent, ent->client->pers.netname);
	
	strcpy (ent->client->pers.squad, "Uncommitted"); // ADC
	strcpy (ent->client->pers.squadStatus, "Unknown"); // ADC

	// set spectator
	s = Info_ValueForKey (userinfo, "spectator");
	// spectators are only supported in deathmatch
	if (deathmatch->value && *s && strcmp(s, "0"))
		ent->client->pers.spectator = true;
	else
		ent->client->pers.spectator = false;


	// set skin
	skin = Info_ValueForKey (userinfo, "skin");

	playernum = ent-g_edicts-1;

	// combine name and skin into a configstring
	gi.configstring (CS_PLAYERSKINS+playernum, va("%s\\%s", ent->client->pers.netname, skin) );

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

	// handedness
	s = Info_ValueForKey (userinfo, "hand");
	if (strlen(s))
	{
		ent->client->pers.hand = atoi(s);
	}

	// save off the userinfo in case we want to check something later
	strncpy (ent->client->pers.userinfo, userinfo, sizeof(ent->client->pers.userinfo)-1);
	
	ClientSetSkin(ent, skin);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x182d0
testl %eax, %eax
jne 0x41a3e
movups 0x14aa2(%rip), %xmm0    # 0x564d0
movups %xmm0, 0xe(%r14)
movups 0x14a88(%rip), %xmm0    # 0x564c2
movups %xmm0, (%r14)
leaq 0x123cc(%rip), %rsi     # 0x53e11
movq %r14, %rdi
callq 0x18c70
movl $0x2c0, %r15d           # imm = 0x2C0
movq 0x58(%rbx), %rdi
addq %r15, %rdi
pushq $0xf
popq %rdx
movq %rax, %rsi
callq 0x181e0
addq 0x58(%rbx), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19a40
movq 0x58(%rbx), %rax
movabsq $0x74696d6d6f636e55, %rcx # imm = 0x74696D6D6F636E55
movq %rcx, 0x2d0(%rax)
movl $0x646574, 0x2d8(%rax)  # imm = 0x646574
movq 0x58(%rbx), %rax
movabsq $0x6e776f6e6b6e55, %rcx # imm = 0x6E776F6E6B6E55
movq %rcx, 0x2e0(%rax)
leaq 0x148db(%rip), %rsi     # 0x5638a
movq %r14, %rdi
callq 0x18c70
movq 0x25402(%rip), %r12     # 0x66ec0
movq (%r12), %rcx
movss 0x20(%rcx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x41ad1
jnp 0x41ae6
movzbl (%rax), %edx
testl %edx, %edx
je 0x41ae6
pushq $0x1
popq %rcx
cmpl $0x30, %edx
jne 0x41ae8
cmpb $0x0, 0x1(%rax)
jne 0x41ae8
xorl %ecx, %ecx
movq 0x58(%rbx), %rax
movl %ecx, 0x750(%rax)
leaq 0xc847(%rip), %rsi      # 0x4e340
movq %r14, %rdi
callq 0x18c70
movq 0x24a50(%rip), %rdx     # 0x66558
movq %rbx, %rcx
subq (%rdx), %rcx
movq %rax, %r15
movl $0x4a8, %esi            # imm = 0x4A8
movq %rcx, %rax
cqto
idivq %rsi
movq 0x24adb(%rip), %rcx     # 0x66600
movq 0x30(%rcx), %r13
leal 0x51f(%rax), %ebp
movl $0x2c0, %esi            # imm = 0x2C0
addq 0x58(%rbx), %rsi
leaq 0x1562e(%rip), %rdi     # 0x5716d
movq %r15, %rdx
xorl %eax, %eax
callq 0x194e0
movl %ebp, %edi
movq %rax, %rsi
callq *%r13
movq (%r12), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x41b64
jnp 0x41b78
movq 0x24aad(%rip), %rax     # 0x66618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
testw %ax, %ax
js 0x41bb0
leaq 0xff41(%rip), %rsi      # 0x51ac0
movq %r14, %rdi
callq 0x18c70
movq %rax, %rdi
callq 0x197a0
cvtsi2ss %eax, %xmm0
movq 0x58(%rbx), %rcx
movss %xmm0, 0x70(%rcx)
testl %eax, %eax
jle 0x41bbd
cmpl $0xa1, %eax
jb 0x41bc4
movl $0x43200000, 0x70(%rcx) # imm = 0x43200000
jmp 0x41bc4
movq 0x58(%rbx), %rax
movl $0x42b40000, 0x70(%rax) # imm = 0x42B40000
jmp 0x41bc4
movl $0x42b40000, 0x70(%rcx) # imm = 0x42B40000
leaq 0x14921(%rip), %rsi     # 0x564ec
movq %r14, %rdi
callq 0x18c70
cmpb $0x0, (%rax)
movq 0x58(%rbx), %r12
je 0x41bec
movq %rax, %rdi
callq 0x197a0
movl %eax, 0x300(%r12)
addq $0xc0, %r12
movl $0x1ff, %edx            # imm = 0x1FF
movq %r12, %rdi
movq %r14, %rsi
callq 0x181e0
movq %rbx, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x198b0