// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_spawn.c
// Function: ED_ParseField
void ED_ParseField (char *key, char *value, edict_t *ent)
{
	field_t	*f;
	byte	*b;
	float	v;
	vec3_t	vec = { 0 };

	for (f=fields ; f->name ; f++)
	{
		if (!(f->flags & FFL_NOSPAWN) && !Q_stricmp(f->name, key))
		{	// found it
			if (f->flags & FFL_SPAWNTEMP)
				b = (byte *)&st;
			else
				b = (byte *)ent;

			switch (f->type)
			{
			case F_LSTRING:
				*(char **)(b+f->ofs) = ED_NewString (value);
				break;
			case F_VECTOR:
				if (sscanf(value, "%f %f %f", &vec[0], &vec[1], &vec[2])) {
					((float*)(b + f->ofs))[0] = vec[0];
					((float*)(b + f->ofs))[1] = vec[1];
					((float*)(b + f->ofs))[2] = vec[2];
				}
				else {
					((float*)(b + f->ofs))[0] = vec[0];	// if we get here, it's an error in the map
					((float*)(b + f->ofs))[1] = vec[1]; // set all zeroes and log a warning.
					((float*)(b + f->ofs))[2] = vec[2];
					gi.dprintf("WARNING: Vector field incomplete in %s, map: %s, field: %s\n", __func__, level.mapname, f->name);
				}
				break;
			case F_INT:
				*(int *)(b+f->ofs) = atoi(value);
				break;
			case F_FLOAT:
				*(float *)(b+f->ofs) = atof(value);
				break;
			case F_ANGLEHACK:
				v = atof(value);
				((float *)(b+f->ofs))[0] = 0;
				((float *)(b+f->ofs))[1] = v;
				((float *)(b+f->ofs))[2] = 0;
				break;
			case F_IGNORE:
				break;
			default:// MJD Added to stop compiler warnings
				break;
			}
			return;
		}
	}
	gi.dprintf ("%s is not a field\n", key);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0xc, %edx
callq 0x188f0
movq 0x37685(%rip), %rax     # 0x82a40
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
je 0x4b5fa
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x4b5e7
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x186f0
cmpl $0x0, %eax
jne 0x4b5e7
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x4b415
movq 0x37259(%rip), %rax     # 0x82668
movq %rax, -0x28(%rbp)
jmp 0x4b41d
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %eax
movq %rax, -0x40(%rbp)
subq $0xb, %rax
ja 0x4b5e3
movq -0x40(%rbp), %rax
leaq 0x29a07(%rip), %rcx     # 0x74e44
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
callq 0x18280
movq %rax, %rdx
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movq %rdx, (%rax,%rcx)
jmp 0x4b5e5
movq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rdx
leaq -0x38(%rbp), %rcx
addq $0x4, %rcx
leaq -0x38(%rbp), %r8
addq $0x8, %r8
leaq 0x29f2e(%rip), %rsi     # 0x753b4
movb $0x0, %al
callq 0x19180
cmpl $0x0, %eax
je 0x4b4d8
movss -0x38(%rbp), %xmm0
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movss %xmm0, (%rax,%rcx)
movss -0x34(%rbp), %xmm0
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movss %xmm0, 0x4(%rax,%rcx)
movss -0x30(%rbp), %xmm0
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movss %xmm0, 0x8(%rax,%rcx)
jmp 0x4b54c
movss -0x38(%rbp), %xmm0
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movss %xmm0, (%rax,%rcx)
movss -0x34(%rbp), %xmm0
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movss %xmm0, 0x4(%rax,%rcx)
movss -0x30(%rbp), %xmm0
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movss %xmm0, 0x8(%rax,%rcx)
movq 0x370dd(%rip), %rax     # 0x82600
movq 0x8(%rax), %r8
movq -0x20(%rbp), %rax
movq (%rax), %rcx
leaq 0x29e88(%rip), %rdi     # 0x753bd
leaq 0x29ebd(%rip), %rsi     # 0x753f9
movq 0x3785d(%rip), %rdx     # 0x82da0
addq $0x48, %rdx
movb $0x0, %al
callq *%r8
jmp 0x4b5e5
movq -0x10(%rbp), %rdi
callq 0x19820
movl %eax, %edx
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movl %edx, (%rax,%rcx)
jmp 0x4b5e5
movq -0x10(%rbp), %rdi
callq 0x18450
cvtsd2ss %xmm0, %xmm0
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movss %xmm0, (%rax,%rcx)
jmp 0x4b5e5
movq -0x10(%rbp), %rdi
callq 0x18450
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x2c(%rbp)
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
xorps %xmm0, %xmm0
movss %xmm0, (%rax,%rcx)
movss -0x2c(%rbp), %xmm0
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movss %xmm0, 0x4(%rax,%rcx)
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
xorps %xmm0, %xmm0
movss %xmm0, 0x8(%rax,%rcx)
jmp 0x4b5e5
jmp 0x4b5e5
jmp 0x4b5e5
jmp 0x4b614
jmp 0x4b5e9
movq -0x20(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x20(%rbp)
jmp 0x4b3bf
movq 0x36fff(%rip), %rax     # 0x82600
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rsi
leaq 0x29df7(%rip), %rdi     # 0x75407
movb $0x0, %al
callq *%rcx
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)