LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: R_ConcatRotations
void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3])
{
	out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] +
				in1[0][2] * in2[2][0];
	out[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] +
				in1[0][2] * in2[2][1];
	out[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] +
				in1[0][2] * in2[2][2];
	out[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] +
				in1[1][2] * in2[2][0];
	out[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] +
				in1[1][2] * in2[2][1];
	out[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] +
				in1[1][2] * in2[2][2];
	out[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] +
				in1[2][2] * in2[2][0];
	out[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] +
				in1[2][2] * in2[2][1];
	out[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] +
				in1[2][2] * in2[2][2];
}

// Assembly:
movss (%rdi), %xmm0
movss 0x4(%rdi), %xmm1
mulss 0xc(%rsi), %xmm1
mulss (%rsi), %xmm0
addss %xmm1, %xmm0
movss 0x8(%rdi), %xmm1
mulss 0x18(%rsi), %xmm1
addss %xmm0, %xmm1
movss %xmm1, (%rdx)
movss (%rdi), %xmm0
movss 0x4(%rdi), %xmm1
mulss 0x10(%rsi), %xmm1
mulss 0x4(%rsi), %xmm0
addss %xmm1, %xmm0
movss 0x8(%rdi), %xmm1
mulss 0x1c(%rsi), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x4(%rdx)
movss (%rdi), %xmm0
movss 0x4(%rdi), %xmm1
mulss 0x14(%rsi), %xmm1
mulss 0x8(%rsi), %xmm0
addss %xmm1, %xmm0
movss 0x8(%rdi), %xmm1
mulss 0x20(%rsi), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x8(%rdx)
movss 0xc(%rdi), %xmm0
movss 0x10(%rdi), %xmm1
mulss 0xc(%rsi), %xmm1
mulss (%rsi), %xmm0
addss %xmm1, %xmm0
movss 0x14(%rdi), %xmm1
mulss 0x18(%rsi), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0xc(%rdx)
movss 0xc(%rdi), %xmm0
movss 0x10(%rdi), %xmm1
mulss 0x10(%rsi), %xmm1
mulss 0x4(%rsi), %xmm0
addss %xmm1, %xmm0
movss 0x14(%rdi), %xmm1
mulss 0x1c(%rsi), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x10(%rdx)
movss 0xc(%rdi), %xmm0
movss 0x10(%rdi), %xmm1
mulss 0x14(%rsi), %xmm1
mulss 0x8(%rsi), %xmm0
addss %xmm1, %xmm0
movss 0x14(%rdi), %xmm1
mulss 0x20(%rsi), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x14(%rdx)
movss 0x18(%rdi), %xmm0
movss 0x1c(%rdi), %xmm1
mulss 0xc(%rsi), %xmm1
mulss (%rsi), %xmm0
addss %xmm1, %xmm0
movss 0x20(%rdi), %xmm1
mulss 0x18(%rsi), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x18(%rdx)
movss 0x18(%rdi), %xmm0
movss 0x1c(%rdi), %xmm1
mulss 0x10(%rsi), %xmm1
mulss 0x4(%rsi), %xmm0
addss %xmm1, %xmm0
movss 0x20(%rdi), %xmm1
mulss 0x1c(%rsi), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x1c(%rdx)
movss 0x18(%rdi), %xmm0
movss 0x1c(%rdi), %xmm1
mulss 0x14(%rsi), %xmm1
mulss 0x8(%rsi), %xmm0
addss %xmm1, %xmm0
movss 0x20(%rdi), %xmm1
mulss 0x20(%rsi), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x20(%rdx)
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: AngleVectors
void AngleVectors (vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
{
	float		angle;
	static float		sr, sp, sy, cr, cp, cy;
	// static to help MS compiler fp bugs

	angle = angles[YAW] * (M_PI*2 / 360);
	sy = sin(angle);
	cy = cos(angle);
	angle = angles[PITCH] * (M_PI*2 / 360);
	sp = sin(angle);
	cp = cos(angle);
	angle = angles[ROLL] * (M_PI*2 / 360);
	sr = sin(angle);
	cr = cos(angle);

	if (forward)
	{
		forward[0] = cp*cy;
		forward[1] = cp*sy;
		forward[2] = -sp;
	}
	if (right)
	{
		right[0] = (-1*sr*sp*cy+-1*cr*-sy);
		right[1] = (-1*sr*sp*sy+-1*cr*cy);
		right[2] = -1*sr*cp;
	}
	if (up)
	{
		up[0] = (cr*sp*cy+-sr*-sy);
		up[1] = (cr*sp*sy+-sr*cy);
		up[2] = cr*cp;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
cvtss2sd 0x4(%rdi), %xmm0
mulsd 0xaae5(%rip), %xmm0     # 0x5bd00
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, (%rsp)
callq 0x19550
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x48e7b(%rip)    # 0x9a0b4
movsd (%rsp), %xmm0
callq 0x18990
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x48e6d(%rip)    # 0x9a0bc
xorps %xmm0, %xmm0
cvtss2sd (%r12), %xmm0
mulsd 0xaaa0(%rip), %xmm0     # 0x5bd00
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, (%rsp)
callq 0x19550
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x48e32(%rip)    # 0x9a0b0
movsd (%rsp), %xmm0
callq 0x18990
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x48e24(%rip)    # 0x9a0b8
xorps %xmm0, %xmm0
cvtss2sd 0x8(%r12), %xmm0
mulsd 0xaa5a(%rip), %xmm0     # 0x5bd00
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, (%rsp)
callq 0x19550
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x48de8(%rip)    # 0x9a0ac
movsd (%rsp), %xmm0
callq 0x18990
testq %r15, %r15
je 0x5130f
movss 0x48ddd(%rip), %xmm1    # 0x9a0b8
movss 0x48dd9(%rip), %xmm2    # 0x9a0bc
mulss %xmm1, %xmm2
movss %xmm2, (%r15)
mulss 0x48dc0(%rip), %xmm1    # 0x9a0b4
movss %xmm1, 0x4(%r15)
movss 0x48dae(%rip), %xmm1    # 0x9a0b0
xorps 0x5907(%rip), %xmm1     # 0x56c10
movss %xmm1, 0x8(%r15)
cvtsd2ss %xmm0, %xmm0
testq %r14, %r14
je 0x51377
movss 0x48d8c(%rip), %xmm1    # 0x9a0ac
xorps 0x58e9(%rip), %xmm1     # 0x56c10
movss 0x48d81(%rip), %xmm2    # 0x9a0b0
mulss %xmm1, %xmm2
movss 0x48d81(%rip), %xmm3    # 0x9a0bc
movss 0x48d71(%rip), %xmm4    # 0x9a0b4
movaps %xmm2, %xmm5
mulss %xmm4, %xmm2
mulss %xmm0, %xmm4
mulss %xmm3, %xmm5
addss %xmm4, %xmm5
movss %xmm5, (%r14)
mulss %xmm0, %xmm3
subss %xmm3, %xmm2
movss %xmm2, 0x4(%r14)
mulss 0x48d47(%rip), %xmm1    # 0x9a0b8
movss %xmm1, 0x8(%r14)
testq %rbx, %rbx
je 0x513d1
movss 0x48d2c(%rip), %xmm1    # 0x9a0b0
mulss %xmm0, %xmm1
movss 0x48d2c(%rip), %xmm2    # 0x9a0bc
movss 0x48d14(%rip), %xmm3    # 0x9a0ac
movss 0x48d14(%rip), %xmm4    # 0x9a0b4
movaps %xmm1, %xmm5
mulss %xmm2, %xmm5
mulss %xmm3, %xmm2
mulss %xmm4, %xmm3
addss %xmm3, %xmm5
movss %xmm5, (%rbx)
mulss %xmm4, %xmm1
subss %xmm2, %xmm1
movss %xmm1, 0x4(%rbx)
mulss 0x48cec(%rip), %xmm0    # 0x9a0b8
movss %xmm0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: ProjectPointOnPlane
void ProjectPointOnPlane( vec3_t dst, const vec3_t p, const vec3_t normal )
{
	float d;
	vec3_t n;
	float inv_denom;

	inv_denom = 1.0F / DotProduct( normal, normal );

	d = DotProduct( normal, p ) * inv_denom;

	n[0] = normal[0] * inv_denom;
	n[1] = normal[1] * inv_denom;
	n[2] = normal[2] * inv_denom;

	dst[0] = p[0] - d * n[0];
	dst[1] = p[1] - d * n[1];
	dst[2] = p[2] - d * n[2];
}

// Assembly:
movss (%rdx), %xmm1
movss 0x4(%rdx), %xmm0
movaps %xmm0, %xmm2
mulss %xmm0, %xmm2
movaps %xmm1, %xmm3
mulss %xmm1, %xmm3
addss %xmm2, %xmm3
movss 0x8(%rdx), %xmm2
movaps %xmm2, %xmm4
mulss %xmm2, %xmm4
addss %xmm3, %xmm4
movss 0x2b18(%rip), %xmm3     # 0x53f28
divss %xmm4, %xmm3
movss (%rsi), %xmm4
movss 0x4(%rsi), %xmm5
mulss %xmm0, %xmm5
movaps %xmm1, %xmm6
mulss %xmm4, %xmm6
addss %xmm5, %xmm6
movss 0x8(%rsi), %xmm5
mulss %xmm2, %xmm5
addss %xmm6, %xmm5
mulss %xmm3, %xmm1
mulss %xmm3, %xmm0
mulss %xmm3, %xmm2
xorps 0x57c4(%rip), %xmm5     # 0x56c10
mulss %xmm3, %xmm5
mulss %xmm5, %xmm1
addss %xmm4, %xmm1
movss %xmm1, (%rdi)
mulss %xmm5, %xmm0
addss 0x4(%rsi), %xmm0
movss %xmm0, 0x4(%rdi)
mulss %xmm2, %xmm5
addss 0x8(%rsi), %xmm5
movss %xmm5, 0x8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: VectorNormalize
vec_t VectorNormalize (vec3_t v)
{
	float	length, ilength;

	length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
	length = sqrt (length);		// FIXME

	if (length)
	{
		ilength = 1/length;
		v[0] *= ilength;
		v[1] *= ilength;
		v[2] *= ilength;
	}
		
	return length;

}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movss (%rdi), %xmm1
movss 0x4(%rdi), %xmm0
mulss %xmm0, %xmm0
mulss %xmm1, %xmm1
addss %xmm0, %xmm1
movss 0x8(%rdi), %xmm0
mulss %xmm0, %xmm0
addss %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x514ad
sqrtss %xmm0, %xmm0
jmp 0x514b5
callq 0x18e80
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x514bc
jnp 0x514ec
movss 0x2a64(%rip), %xmm1     # 0x53f28
divss %xmm0, %xmm1
movss (%rbx), %xmm2
mulss %xmm1, %xmm2
movss %xmm2, (%rbx)
movss 0x4(%rbx), %xmm2
mulss %xmm1, %xmm2
movss %xmm2, 0x4(%rbx)
mulss 0x8(%rbx), %xmm1
movss %xmm1, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: BoxOnPlaneSide2
int BoxOnPlaneSide2 (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
{
	int		i;
	float	dist1, dist2;
	int		sides;
	vec3_t	corners[2];

	for (i=0 ; i<3 ; i++)
	{
		if (p->normal[i] < 0)
		{
			corners[0][i] = emins[i];
			corners[1][i] = emaxs[i];
		}
		else
		{
			corners[1][i] = emins[i];
			corners[0][i] = emaxs[i];
		}
	}
	dist1 = DotProduct (p->normal, corners[0]) - p->dist;
	dist2 = DotProduct (p->normal, corners[1]) - p->dist;
	sides = 0;
	if (dist1 >= 0)
		sides = 1;
	if (dist2 < 0)
		sides |= 2;

	return sides;
}

// Assembly:
leaq -0x18(%rsp), %rax
xorl %ecx, %ecx
xorps %xmm0, %xmm0
ucomiss (%rdx,%rcx,4), %xmm0
leaq 0xc(%rax), %r8
movss (%rdi,%rcx,4), %xmm1
movq %r8, %r9
cmovaq %rax, %r9
movss %xmm1, (%r9)
movss (%rsi,%rcx,4), %xmm1
cmovbeq %rax, %r8
movss %xmm1, (%r8)
incq %rcx
addq $0x4, %rax
cmpq $0x3, %rcx
jne 0x51785
movss (%rdx), %xmm0
movss 0x4(%rdx), %xmm1
movss -0x14(%rsp), %xmm2
mulss %xmm1, %xmm2
movss -0x18(%rsp), %xmm3
mulss %xmm0, %xmm3
addss %xmm2, %xmm3
movss 0x8(%rdx), %xmm2
movss -0x10(%rsp), %xmm4
mulss %xmm2, %xmm4
addss %xmm3, %xmm4
movss 0xc(%rdx), %xmm3
subss %xmm3, %xmm4
mulss -0x8(%rsp), %xmm1
mulss -0xc(%rsp), %xmm0
addss %xmm1, %xmm0
mulss -0x4(%rsp), %xmm2
addss %xmm0, %xmm2
xorps %xmm0, %xmm0
xorl %ecx, %ecx
ucomiss %xmm0, %xmm4
setae %cl
leal 0x2(%rcx), %eax
ucomiss %xmm2, %xmm3
cmovbel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: AddPointToBounds
void AddPointToBounds (vec3_t v, vec3_t mins, vec3_t maxs)
{
	int		i;
	vec_t	val;

	for (i=0 ; i<3 ; i++)
	{
		val = v[i];
		if (val < mins[i])
			mins[i] = val;
		if (val > maxs[i])
			maxs[i] = val;
	}
}

// Assembly:
xorl %eax, %eax
movss (%rdi,%rax,4), %xmm0
movss (%rsi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x519d3
movss %xmm0, (%rsi,%rax,4)
ucomiss (%rdx,%rax,4), %xmm0
jbe 0x519de
movss %xmm0, (%rdx,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x519bf
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: VectorNormalize2
vec_t VectorNormalize2 (vec3_t v, vec3_t out)
{
	float	length, ilength;

	length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
	length = sqrt (length);		// FIXME

	if (length)
	{
		ilength = 1/length;
		out[0] = v[0]*ilength;
		out[1] = v[1]*ilength;
		out[2] = v[2]*ilength;
	}
		
	return length;

}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movss (%rdi), %xmm1
movss 0x4(%rdi), %xmm0
mulss %xmm0, %xmm0
mulss %xmm1, %xmm1
addss %xmm0, %xmm1
movss 0x8(%rdi), %xmm0
mulss %xmm0, %xmm0
addss %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x51a50
sqrtss %xmm0, %xmm0
jmp 0x51a58
callq 0x18e80
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x51a5f
jnp 0x51a92
movss 0x24c1(%rip), %xmm1     # 0x53f28
divss %xmm0, %xmm1
movss (%r14), %xmm2
mulss %xmm1, %xmm2
movss %xmm2, (%rbx)
movss 0x4(%r14), %xmm2
mulss %xmm1, %xmm2
movss %xmm2, 0x4(%rbx)
mulss 0x8(%r14), %xmm1
movss %xmm1, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: VectorLength
vec_t VectorLength(vec3_t v)
{
	int		i;
	float	length;
	
	length = 0;
	for (i=0 ; i< 3 ; i++)
		length += v[i]*v[i];

	length = sqrt (length);		// FIXME

	return length;
}

// Assembly:
xorps %xmm0, %xmm0
xorl %eax, %eax
movss (%rdi,%rax,4), %xmm1
mulss %xmm1, %xmm1
addss %xmm1, %xmm0
incq %rax
cmpq $0x3, %rax
jne 0x51b6a
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x18e80
sqrtss %xmm0, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: COM_FileExtension
char *COM_FileExtension (char *in)
{
	static char exten[8];
	int		i;

	while (*in && *in != '.')
		in++;
	if (!*in)
		return "";
	in++;
	for (i=0 ; i<7 && *in ; i++,in++)
		exten[i] = *in;
	exten[i] = 0;
	return exten;
}

// Assembly:
incq %rdi
movzbl -0x1(%rdi), %eax
testl %eax, %eax
je 0x51c69
cmpl $0x2e, %eax
jne 0x51c31
xorl %ecx, %ecx
leaq 0x48476(%rip), %rax     # 0x9a0c0
movb (%rdi,%rcx), %dl
testb %dl, %dl
je 0x51c62
movb %dl, (%rcx,%rax)
incq %rcx
cmpq $0x7, %rcx
jne 0x51c4a
movl $0x7, %ecx
movl %ecx, %ecx
movb $0x0, (%rcx,%rax)
retq
leaq 0x3295(%rip), %rax      # 0x54f05
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: COM_FileBase
void COM_FileBase (char *in, char *out)
{
	char *s, *s2;
	
	s = in + strlen(in) - 1;
	
	while (s != in && *s != '.')
		s--;
	
	for (s2 = s ; s2 != in && *s2 != '/' ; s2--)
	;
	
	if (s-s2 < 2)
		out[0] = 0;
	else
	{
		s--;
		strncpy (out,s2+1, s-s2);
		out[s-s2] = 0;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x18680
leaq (%r14,%rax), %rcx
leaq 0x1(%r14), %r15
decq %rax
testq %rax, %rax
je 0x51ca2
decq %rcx
decq %rax
cmpb $0x2e, (%rcx)
jne 0x51c8c
leaq 0x1(%rcx), %r15
jmp 0x51ca5
movq %r14, %rcx
movq %rcx, %rsi
cmpq %r14, %rcx
je 0x51cc0
movq %rcx, %rsi
cmpb $0x2f, (%rsi)
je 0x51cc0
decq %rsi
cmpq %r14, %rsi
jne 0x51cb0
movq %r14, %rsi
subq %rsi, %rcx
cmpq $0x2, %rcx
jl 0x51ce2
subq %rsi, %r15
incq %rsi
leaq -0x2(%r15), %rdx
movq %rbx, %rdi
callq 0x181c0
addq %r15, %rbx
addq $-0x2, %rbx
movb $0x0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: COM_FilePath
void COM_FilePath (char *in, char *out)
{
	char *s;
	
	s = in + strlen(in) - 1;
	
	while (s != in && *s != '/')
		s--;

	strncpy (out,in, s-in);
	out[s-in] = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x18680
cmpq $0x1, %rax
je 0x51d15
leaq -0x1(%rax), %r15
cmpb $0x2f, -0x1(%r14,%rax)
movq %r15, %rax
jne 0x51cfb
addq %r14, %r15
jmp 0x51d18
movq %r14, %r15
subq %r14, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x181c0
movb $0x0, (%rbx,%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: COM_DefaultExtension
void COM_DefaultExtension (char *path, char *extension)
{
	char    *src;
//
// if path doesn't have a .EXT, append extension
// (extension should include the .)
//
	src = path + strlen(path) - 1;

	while (*src != '/' && src != path)
	{
		if (*src == '.')
			return;                 // it has an extension
		src--;
	}

	strcat (path, extension);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x18680
decq %rax
movb (%r14,%rax), %cl
cmpb $0x2f, %cl
je 0x51d64
testq %rax, %rax
je 0x51d64
decq %rax
cmpb $0x2e, %cl
jne 0x51d46
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x19640
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: COM_Parse
char* COM_Parse(char** data_p)
{
	int         c;
	int         len;
	char* data;
	char* s = com_token[com_tokidx++ & 3];

	data = *data_p;
	len = 0;
	s[0] = 0;

	if (!data) {
		*data_p = NULL;
		return s;
	}

	// skip whitespace
skipwhite:
	while ((c = *data) <= ' ') {
		if (c == 0) {
			*data_p = NULL;
			return s;
		}
		data++;
	}

	// skip // comments
	if (c == '/' && data[1] == '/') {
		data += 2;
		while (*data && *data != '\n')
			data++;
		goto skipwhite;
	}

	// skip /* */ comments
	if (c == '/' && data[1] == '*') {
		data += 2;
		while (*data) {
			if (data[0] == '*' && data[1] == '/') {
				data += 2;
				break;
			}
			data++;
		}
		goto skipwhite;
	}

	// handle quoted strings specially
	if (c == '\"') {
		data++;
		while (1) {
			c = *data++;
			if (c == '\"' || !c) {
				goto finish;
			}

			if (len < MAX_TOKEN_CHARS - 1) {
				s[len++] = c;
			}
		}
	}

	// parse a regular word
	do {
		if (len < MAX_TOKEN_CHARS - 1) {
			s[len++] = c;
		}
		data++;
		c = *data;
	} while (c > 32);

finish:
	s[len] = 0;

	*data_p = data;
	return s;
}

// Assembly:
movl 0x488b7(%rip), %edx     # 0x9a6d0
leal 0x1(%rdx), %eax
movl %eax, 0x488ae(%rip)     # 0x9a6d0
andl $0x3, %edx
shll $0x7, %edx
leaq 0x486a1(%rip), %rsi     # 0x9a4d0
leaq (%rsi,%rdx), %rax
movq (%rdi), %rcx
movb $0x0, (%rdx,%rsi)
testq %rcx, %rcx
je 0x51ea6
movb (%rcx), %sil
cmpb $0x20, %sil
jg 0x51e5a
testb %sil, %sil
je 0x51ea6
movb 0x1(%rcx), %sil
incq %rcx
cmpb $0x21, %sil
jl 0x51e48
cmpb $0x2f, %sil
jne 0x51eac
movzbl 0x1(%rcx), %edx
cmpl $0x2a, %edx
je 0x51e83
cmpl $0x2f, %edx
jne 0x51ede
addq $0x2, %rcx
movzbl (%rcx), %edx
testl %edx, %edx
je 0x51e3f
cmpl $0xa, %edx
je 0x51e3f
incq %rcx
jmp 0x51e72
addq $0x2, %rcx
movzbl (%rcx), %edx
cmpl $0x2a, %edx
je 0x51e95
testl %edx, %edx
jne 0x51e9b
jmp 0x51e3f
cmpb $0x2f, 0x1(%rcx)
je 0x51ea0
incq %rcx
jmp 0x51e87
addq $0x2, %rcx
jmp 0x51e3f
xorl %ecx, %ecx
movq %rcx, (%rdi)
retq
movzbl %sil, %edx
cmpl $0x22, %edx
jne 0x51ee4
incq %rcx
xorl %edx, %edx
movzbl (%rcx), %esi
testl %esi, %esi
je 0x51ed9
cmpl $0x22, %esi
je 0x51ed9
incq %rcx
cmpl $0x7e, %edx
ja 0x51eba
movl %edx, %r8d
incl %edx
movb %sil, (%rax,%r8)
jmp 0x51eba
incq %rcx
jmp 0x51f01
cmpb $0x22, %sil
je 0x51eb5
xorl %edx, %edx
cmpl $0x7e, %edx
jg 0x51ef4
movslq %edx, %r8
incl %edx
movb %sil, (%rax,%r8)
movb 0x1(%rcx), %sil
incq %rcx
cmpb $0x20, %sil
jg 0x51ee6
movslq %edx, %rdx
movb $0x0, (%rax,%rdx)
jmp 0x51ea8
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: Q_strnicmp
int Q_strnicmp(const char* s1, const char* s2, size_t count)
{
	if (count == 0)
		return 0;
	else
	{
		while (count-- != 0 && tolower(*s1) == tolower(*s2))
		{
			if (count == 0 || *s1 == '\0' || *s2 == '\0')
				break;
			s1++;
			s2++;
		}

		return tolower(*(unsigned char*)s1) - tolower(*(unsigned char*)s2);
	}
}

// Assembly:
testq %rdx, %rdx
je 0x51ff2
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x19a30
movq (%rax), %rcx
movsbq (%r15), %rax
movsbq (%r14), %rdx
testq %rdx, %rdx
je 0x51fe0
testb %al, %al
je 0x51fe0
movl (%rcx,%rdx,4), %esi
cmpl %esi, (%rcx,%rax,4)
jne 0x51fe0
movq %rbx, %rsi
decq %rsi
je 0x51fe0
addq $-0x2, %rbx
xorl %esi, %esi
movsbq 0x1(%r15,%rsi), %rax
movsbq 0x1(%r14,%rsi), %rdx
testq %rdx, %rdx
je 0x51fe0
testb %al, %al
je 0x51fe0
movl (%rcx,%rdx,4), %edi
cmpl %edi, (%rcx,%rax,4)
jne 0x51fe0
leaq 0x1(%rsi), %rdi
cmpq %rsi, %rbx
movq %rdi, %rsi
jne 0x51fb7
movzbl %al, %eax
movl (%rcx,%rax,4), %eax
movzbl %dl, %edx
subl (%rcx,%rdx,4), %eax
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: Com_sprintf
void Com_sprintf(char* dest, int size, char* fmt, ...)
{
	int		len;
	va_list	argptr;

	va_start(argptr, fmt);
	len = vsprintf(bigbuffer, fmt, argptr);
	va_end(argptr);
	if (len < size)
		strncpy(dest, bigbuffer, (size_t)size - 1);
	else
		Com_Printf("Com_sprintf: overflow of %i in %i\n", len, size);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x20(%rsp), %rsi
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x52050
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rax
movq %rsi, 0x10(%rax)
leaq 0xf0(%rsp), %rcx
movq %rcx, 0x8(%rax)
movabsq $0x3000000018, %rcx     # imm = 0x3000000018
movq %rcx, (%rax)
leaq 0x48669(%rip), %rdi     # 0x9a6e0
movq %rdx, %rsi
movq %rax, %rdx
callq 0x19320
cmpl %ebx, %eax
jge 0x5209d
movslq %ebx, %rdx
decq %rdx
leaq 0x4864d(%rip), %rsi     # 0x9a6e0
movq %r14, %rdi
callq 0x181c0
jmp 0x520af
leaq 0x9cda(%rip), %rdi      # 0x5bd7e
movl %eax, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x18f20
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: Info_ValueForKey
char *Info_ValueForKey (char *s, char *key)
{
	char	pkey[MAX_INFO_STRING];
	static	char value[2][MAX_INFO_STRING]; // Use two buffers so compares work without stomping on each other.
	static	int	valueindex;
	char	*o;
	
	valueindex ^= 1;
	if (*s == '\\')
		s++;
	while (1)
	{
		o = pkey;
		while (*s != '\\')
		{
			if (!*s)
				return "";
			*o++ = *s++;
		}
		*o = 0;
		s++;

		o = value[valueindex];

		while (*s != '\\' && *s)
		{
			if (!*s)
				return "";
			*o++ = *s++;
		}
		*o = 0;

		if (!strcmp (key, pkey) )
			return value[valueindex];

		if (!*s)
			return "";
		s++;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rsi, %rbx
movl 0x58a0d(%rip), %eax     # 0xaaae0
xorq $0x1, %rax
movl %eax, 0x58a03(%rip)     # 0xaaae0
xorl %r12d, %r12d
cmpb $0x5c, (%rdi)
sete %r12b
addq %rdi, %r12
shlq $0x9, %rax
leaq 0x585eb(%rip), %r13     # 0xaa6e0
addq %rax, %r13
movq %rsp, %r15
leaq 0x2e03(%rip), %r14      # 0x54f05
movq %r15, %rax
movzbl (%r12), %ecx
cmpl $0x5c, %ecx
je 0x5211d
testl %ecx, %ecx
je 0x52162
incq %r12
movb %cl, (%rax)
incq %rax
jmp 0x52105
movb $0x0, (%rax)
addq $0x2, %r12
movq %r13, %rax
movzbl -0x1(%r12), %ecx
testl %ecx, %ecx
je 0x52140
cmpl $0x5c, %ecx
je 0x52140
movb %cl, (%rax)
incq %rax
incq %r12
jmp 0x52127
movb $0x0, (%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18b20
testl %eax, %eax
je 0x5215f
cmpb $0x0, -0x1(%r12)
movq %r15, %rax
jne 0x52105
jmp 0x52162
movq %r13, %r14
movq %r14, %rax
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: Info_RemoveKey
void Info_RemoveKey (char *s, char *key)
{
	char	*start;
	char	pkey[MAX_INFO_STRING];
	char	value[MAX_INFO_STRING];
	char	*o;

	if (strstr (key, "\\"))
	{
//		Com_Printf ("Can't use a key with a \\\n");
		return;
	}

	while (1)
	{
		start = s;
		if (*s == '\\')
			s++;
		o = pkey;
		while (*s != '\\')
		{
			if (!*s)
				return;
			*o++ = *s++;
		}
		*o = 0;
		s++;

		o = value;
		while (*s != '\\' && *s)
		{
			if (!*s)
				return;
			*o++ = *s++;
		}
		*o = 0;

		if (!strcmp (key, pkey) )
		{
			strcpy (start, s);	// remove this part
			return;
		}

		if (!*s)
			return;
	}

}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movl $0x5c, %esi
callq 0x18730
testq %rax, %rax
je 0x521af
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x200(%rsp), %r13
movq %rsp, %r15
xorl %ecx, %ecx
cmpb $0x5c, (%r14)
sete %cl
leaq (%r14,%rcx), %rax
leaq (%r14,%rcx), %r12
incq %r12
xorl %ecx, %ecx
movzbl (%rax,%rcx), %edx
testl %edx, %edx
je 0x5219e
cmpl $0x5c, %edx
je 0x521e8
movb %dl, (%rsp,%rcx)
incq %rcx
incq %r12
jmp 0x521d0
movb $0x0, (%rsp,%rcx)
movq %r13, %rax
movzbl (%r12), %ecx
testl %ecx, %ecx
je 0x52207
cmpl $0x5c, %ecx
je 0x52207
movb %cl, (%rax)
incq %rax
incq %r12
jmp 0x521ef
movb $0x0, (%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18b20
testl %eax, %eax
je 0x52228
cmpb $0x0, (%r12)
movq %r12, %r14
jne 0x521ba
jmp 0x5219e
movq %r14, %rdi
movq %r12, %rsi
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x182a0
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: Info_SetValueForKey
void Info_SetValueForKey (char *s, char *key, char *value)
{
	char	newi[MAX_INFO_STRING], *v;
	int		c;
	size_t	maxsize = MAX_INFO_STRING;

	if (strstr (key, "\\") || strstr (value, "\\") )
	{
		Com_Printf ("Can't use keys or values with a \\\n");
		return;
	}

	if (strstr (key, ";") )
	{
		Com_Printf ("Can't use keys or values with a semicolon\n");
		return;
	}

	if (strstr (key, "\"") || strstr (value, "\"") )
	{
		Com_Printf ("Can't use keys or values with a \"\n");
		return;
	}

	if (strlen(key) > MAX_INFO_KEY-1 || strlen(value) > MAX_INFO_KEY-1)
	{
		Com_Printf ("Keys and values must be < 64 characters.\n");
		return;
	}
	Info_RemoveKey (s, key);
	if (!value || !strlen(value))
		return;

	Com_sprintf (newi, sizeof(newi), "\\%s\\%s", key, value);

	if (strlen(newi) + strlen(s) > maxsize)
	{
		Com_Printf ("Info string length exceeded\n");
		return;
	}

	// only copy ascii values
	s += strlen(s);
	v = newi;
	while (*v)
	{
		c = *v++;
		c &= 127;		// strip high bits
		if (c >= 32 && c < 127)
			*s++ = c;
	}
	*s = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
movl $0x5c, %esi
callq 0x18730
testq %rax, %rax
jne 0x522b0
movq %r14, %rdi
movl $0x5c, %esi
callq 0x18730
testq %rax, %rax
je 0x522cc
leaq 0x9aea(%rip), %rdi      # 0x5bda1
xorl %eax, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x18f20
movq %r15, %rdi
movl $0x3b, %esi
callq 0x18730
testq %rax, %rax
je 0x522e7
leaq 0x9adf(%rip), %rdi      # 0x5bdc4
jmp 0x522b7
movq %r15, %rdi
movl $0x22, %esi
callq 0x18730
testq %rax, %rax
jne 0x5230b
movq %r14, %rdi
movl $0x22, %esi
callq 0x18730
testq %rax, %rax
je 0x52314
leaq 0x9add(%rip), %rdi      # 0x5bdef
jmp 0x522b7
movq %r15, %rdi
callq 0x18680
cmpq $0x3f, %rax
ja 0x52330
movq %r14, %rdi
callq 0x18680
cmpq $0x40, %rax
jb 0x5233c
leaq 0x9adb(%rip), %rdi      # 0x5be12
jmp 0x522b7
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19760
testq %r14, %r14
je 0x523dd
cmpb $0x0, (%r14)
je 0x523dd
leaq 0x9adb(%rip), %rdx      # 0x5be3c
movq %rsp, %r12
movq %r12, %rdi
movl $0x200, %esi            # imm = 0x200
movq %r15, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x18e10
movq %r12, %rdi
callq 0x18680
movq %rax, %r14
movq %rbx, %rdi
callq 0x18680
addq %rax, %r14
cmpq $0x201, %r14            # imm = 0x201
jb 0x523a8
leaq 0x9aa4(%rip), %rdi      # 0x5be43
xorl %eax, %eax
callq 0x18f20
jmp 0x523dd
addq %rax, %rbx
movb (%rsp), %cl
testb %cl, %cl
je 0x523da
leaq 0x1(%rsp), %rax
andb $0x7f, %cl
cmpb $0x20, %cl
setb %dl
cmpb $0x7f, %cl
sete %sil
orb %dl, %sil
jne 0x523d1
movb %cl, (%rbx)
incq %rbx
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x523b7
movb $0x0, (%rbx)
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/lupyuen[P]lora-sx1262/npl/linux/src/os_eventq.cc
// Function: ble_npl_eventq_is_empty
bool
ble_npl_eventq_is_empty(struct ble_npl_eventq *evq)
{
    wqueue_t *q = static_cast<wqueue_t *>(evq->q);

    if (q->size()) {
        return 1;
    } else {
        return 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq (%rdi), %r14
leaq 0x18(%r14), %rbx
movq %rbx, %rdi
callq 0x2210
cmpl $0x0, 0x10(%r14)
setne %r14b
movq %rbx, %rdi
callq 0x2120
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lupyuen[P]lora-sx1262/npl/linux/src/wqueue.h
// Function: wqueue<ble_npl_event*>::wqueue()
wqueue()
    {
        pthread_mutexattr_init(&m_mutex_attr);
        pthread_mutexattr_settype(&m_mutex_attr, PTHREAD_MUTEX_RECURSIVE);
        pthread_mutex_init(&m_mutex, &m_mutex_attr);
        pthread_cond_init(&m_condv, NULL);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq %rdi, 0x8(%rdi)
movq %rdi, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x40(%rdi), %r14
movq %r14, %rdi
callq 0x2060
movq %r14, %rdi
movl $0x1, %esi
callq 0x2220
leaq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0x2230
addq $0x48, %rbx
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x2190
// File: /workspace/github_c_makefile_star2_O1/lupyuen[P]lora-sx1262/npl/linux/src/wqueue.h
// Function: wqueue<ble_npl_event*>::put(ble_npl_event*)
void put(T item) {
        pthread_mutex_lock(&m_mutex);
        m_queue.push_back(item);
        pthread_cond_signal(&m_condv);
        pthread_mutex_unlock(&m_mutex);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x18(%rdi), %r15
movq %r15, %rdi
callq 0x2210
movl $0x18, %edi
callq 0x2170
movq %rbx, 0x10(%rax)
movq %rax, %rdi
movq %r14, %rsi
callq 0x2070
incq 0x10(%r14)
addq $0x48, %r14
movq %r14, %rdi
callq 0x2030
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2120
nop
// File: /workspace/github_c_makefile_star2_O1/lupyuen[P]lora-sx1262/npl/linux/src/wqueue.h
// Function: wqueue<ble_npl_event*>::get(unsigned int)
T get(uint32_t tmo) {
        pthread_mutex_lock(&m_mutex);
        if (tmo) {
            while (m_queue.size() == 0) {
                pthread_cond_wait(&m_condv, &m_mutex);
            }
        }

        T item = NULL;

        if (m_queue.size() != 0) {
            item = m_queue.front();
            m_queue.pop_front();
        }

        pthread_mutex_unlock(&m_mutex);
        return item;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r15d
movq %rdi, %r14
leaq 0x18(%rdi), %rbx
movq %rbx, %rdi
callq 0x2210
testl %r15d, %r15d
je 0x264f
cmpq $0x0, 0x10(%r14)
jne 0x264f
leaq 0x48(%r14), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2250
cmpq $0x0, 0x10(%r14)
je 0x263d
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x267e
movq (%r14), %r12
movq 0x10(%r12), %r15
decq %rax
movq %rax, 0x10(%r14)
movq %r12, %rdi
callq 0x2280
movl $0x18, %esi
movq %r12, %rdi
callq 0x2180
jmp 0x2681
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x2120
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/lupyuen[P]lora-sx1262/src/main.c
// Function: main
int main(void) {

//  Uncomment to read SX1262 registers
//  #define READ_REGISTERS
#ifdef READ_REGISTERS
    //  Read SX1262 registers 0x00 to 0x0F
    read_registers();
#endif  //  READ_REGISTERS

    //  TODO: Create a Background Thread to handle LoRa Events
    create_task();

    //  Init SX1262 driver
    init_driver();

    //  TODO: Do we need to wait?
    sleep(1);

//  Uncomment to send a LoRa message
//  #define SEND_MESSAGE
#ifdef SEND_MESSAGE
    //  Send a LoRa message
    send_message();
#endif  //  SEND_MESSAGE

//  Uncomment to receive a LoRa message
#define RECEIVE_MESSAGE
#ifdef RECEIVE_MESSAGE
    //  Handle LoRa events for the next 10 seconds
    for (int i = 0; i < 10; i++) {
        //  Prepare to receive a LoRa message
        receive_message();

        //  Process the received LoRa message, if any
        RadioOnDioIrq(NULL);
        
        //  Sleep for 1 second
        usleep(1000 * 1000);
    }
#endif  //  RECEIVE_MESSAGE

    //  TODO: Close the SPI Bus
    //  close(spi);
    puts("Done!");
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
leaq 0x3912(%rip), %rdi      # 0x6092
callq 0x2260
leaq 0x7a34(%rip), %rdi      # 0xa1c0
callq 0x2416
leaq 0x7a30(%rip), %rdi      # 0xa1c8
leaq 0x251(%rip), %rsi       # 0x29f0
xorl %ebx, %ebx
xorl %edx, %edx
callq 0x251d
leaq 0x38c1(%rip), %rdi      # 0x6070
callq 0x2260
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %rdi
movaps %xmm0, (%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x30(%rdi)
movq $0x0, 0x40(%rdi)
leaq 0x102(%rip), %rax       # 0x28db
movq %rax, (%rdi)
leaq 0x119(%rip), %rax       # 0x28fc
movq %rax, 0x10(%rdi)
leaq 0x19d(%rip), %rax       # 0x298b
movq %rax, 0x8(%rdi)
leaq 0x1b4(%rip), %rax       # 0x29ad
movq %rax, 0x18(%rdi)
leaq 0x1cb(%rip), %rax       # 0x29cf
movq %rax, 0x20(%rdi)
leaq 0x7501(%rip), %r14      # 0x9d10
callq *(%r14)
movl $0x3703dcc0, %edi       # imm = 0x3703DCC0
callq *0x18(%r14)
subq $0x8, %rsp
movl $0x1, %r15d
movl $0x1, %edi
movl $0xe, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x7, %r8d
movl $0x1, %r9d
pushq $0xbb8                  # imm = 0xBB8
pushq %rbx
pushq %rbx
pushq %rbx
pushq %r15
pushq %rbx
pushq $0x8
callq *0x38(%r14)
addq $0x40, %rsp
movl $0x1, %edi
xorl %esi, %esi
movl $0x7, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
movl $0x8, %r9d
pushq %r15
pushq %rbx
pushq %rbx
pushq %rbx
pushq %r15
pushq %rbx
pushq %rbx
pushq $0x5
callq *0x30(%r14)
addq $0x40, %rsp
movl $0x1, %edi
callq 0x2110
movq 0x68(%r14), %r14
movl $0xa, %r15d
leaq 0x37e6(%rip), %rbx      # 0x6082
movq %rbx, %rdi
callq 0x2260
movl $0x2710, %edi           # imm = 0x2710
callq *%r14
xorl %edi, %edi
callq 0x39d6
movl $0xf4240, %edi          # imm = 0xF4240
callq 0x21f0
decl %r15d
jne 0x289c
leaq 0x37a1(%rip), %rdi      # 0x606a
callq 0x2260
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lupyuen[P]lora-sx1262/src/main.c
// Function: on_rx_done
static void on_rx_done(
    uint8_t *payload,  //  Buffer containing received LoRa message
    uint16_t size,     //  Size of the LoRa message
    int16_t rssi,      //  Signal strength
    int8_t snr)        //  Signal To Noise ratio
{
    printf("Rx done: \r\n");

    //  Switch the LoRa Transceiver to low power, sleep mode
    Radio.Sleep();

    //  Copy the received packet
    if (size > sizeof loraping_buffer) {
        size = sizeof loraping_buffer;
    }
    loraping_rx_size = size;
    memcpy(loraping_buffer, payload, size);

    //  Log the signal strength, signal to noise ratio
    //  TODO: loraping_rxinfo_rxed(rssi, snr);

    //  Dump the contents of the received packet
    for (int i = 0; i < loraping_rx_size; i++) {
        printf("%02x ", loraping_buffer[i]);
    }
    printf("\r\n");

    //  TODO: Send a "PING" or "PONG" LoRa message
    //  os_eventq_put(os_eventq_dflt_get(), &loraping_ev_tx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %r15
leaq 0x37a1(%rip), %rdi      # 0x60b4
callq 0x2260
leaq 0x73f1(%rip), %rax      # 0x9d10
callq *0x58(%rax)
cmpw $0x40, %r14w
movl $0x40, %edx
cmovbl %r14d, %edx
movl %edx, 0x78aa(%rip)      # 0xa1e0
leaq 0x78b3(%rip), %rbx      # 0xa1f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2130
testl %r14d, %r14d
je 0x2975
leaq 0x3728(%rip), %r14      # 0x607c
xorl %r15d, %r15d
movzbl (%r15,%rbx), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2050
incq %r15
movslq 0x7870(%rip), %rax      # 0xa1e0
cmpq %rax, %r15
jl 0x2957
leaq 0x3741(%rip), %rdi      # 0x60bd
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2260
// File: /workspace/github_c_makefile_star2_O1/lupyuen[P]lora-sx1262/src/radio.c
// Function: RadioInit
void RadioInit( RadioEvents_t *events )
{
    ////  We copy the Event Callbacks from "events", because
    ////  "events" may be stored on the stack
    assert(events != NULL);
    memcpy(&RadioEvents, events, sizeof(RadioEvents));

    ////  Previously: RadioEvents = events;

    SX126xInit( RadioOnDioIrq );
    SX126xSetStandby( STDBY_RC );

    ////  TODO: Declare the power regulation used to power the device
    ////  This command allows the user to specify if DC-DC or LDO is used for power regulation.
    ////  Using only LDO implies that the Rx or Tx current is doubled

    //// #warning SX126x is set to LDO power regulator mode (instead of DC-DC)
    //// SX126xSetRegulatorMode( USE_LDO );   ////  Default: Use LDO

    //// #warning SX126x is set to DC-DC power regulator mode (instead of LDO)
    SX126xSetRegulatorMode( USE_DCDC );  ////  Use DC-DC

    SX126xSetBufferBaseAddress( 0x00, 0x00 );
    ////TODO: SX126xSetTxParams( 0, RADIO_RAMP_200_US );
    SX126xSetTxParams( 22, RADIO_RAMP_3400_US ); //// TODO
    SX126xSetDioIrqParams( IRQ_RADIO_ALL, IRQ_RADIO_ALL, IRQ_RADIO_NONE, IRQ_RADIO_NONE );

    // Add registers to the retention list (4 is the maximum possible number)
    RadioAddRegisterToRetentionList( REG_RX_GAIN );
    RadioAddRegisterToRetentionList( REG_TX_MODULATION );

    // Initialize driver timeout timers
    TimerInit( &TxTimeoutTimer, RadioOnTxTimeoutIrq );
    TimerInit( &RxTimeoutTimer, RadioOnRxTimeoutIrq );

    IrqFired = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x2aba
movq %rdi, %rsi
leaq 0x7819(%rip), %rdi      # 0xa240
movl $0x9, %ecx
rep  movsq (%rsi), %es:(%rdi)
leaq 0xfa0(%rip), %rdi       # 0x39d6
callq 0x3b14
xorl %edi, %edi
callq 0x3b57
movl $0x1, %edi
callq 0x4056
xorl %edi, %edi
xorl %esi, %esi
callq 0x46ab
movl $0x16, %edi
movl $0x7, %esi
callq 0x4300
movl $0xffff, %edi           # imm = 0xFFFF
movl $0xffff, %esi           # imm = 0xFFFF
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x4199
movl $0x8ac, %edi            # imm = 0x8AC
callq 0x39f3
movl $0x889, %edi            # imm = 0x889
callq 0x39f3
leaq 0x77f6(%rip), %rdi      # 0xa288
leaq 0xfda(%rip), %rsi       # 0x3a73
callq 0x4f31
leaq 0x781b(%rip), %rdi      # 0xa2c0
leaq 0xfe8(%rip), %rsi       # 0x3a94
callq 0x4f31
movb $0x0, 0x7781(%rip)      # 0xa239
popq %rbp
retq
leaq 0x372b(%rip), %rdi      # 0x61ec
leaq 0x3733(%rip), %rsi      # 0x61fb
leaq 0x3738(%rip), %rcx      # 0x6207
movl $0x20f, %edx            # imm = 0x20F
callq 0x20f0
// File: /workspace/github_c_makefile_star2_O1/lupyuen[P]lora-sx1262/src/radio.c
// Function: RadioSetModem
void RadioSetModem( RadioModems_t modem )
{
    printf("RadioSetModem\r\n");
    switch( modem )
    {
    default:
    case MODEM_FSK:
        SX126xSetPacketType( PACKET_TYPE_GFSK );
        // When switching to GFSK mode the LoRa SyncWord register value is reset
        // Thus, we also reset the RadioPublicNetwork variable
        RadioPublicNetwork.Current = false;
        break;
    case MODEM_LORA:
        SX126xSetPacketType( PACKET_TYPE_LORA );
        // Public/Private network register is reset when switching modems
        if( RadioPublicNetwork.Current != RadioPublicNetwork.Previous )
        {
            RadioPublicNetwork.Current = RadioPublicNetwork.Previous;
            RadioSetPublicNetwork( RadioPublicNetwork.Current );
        }
        break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x3a44(%rip), %rdi      # 0x654f
callq 0x2260
cmpl $0x1, %ebx
jne 0x2b41
movl $0x1, %edi
callq 0x42d7
movb 0x77d3(%rip), %al       # 0xa2f8
cmpb %al, 0x77ce(%rip)       # 0xa2f9
je 0x2b4f
movb %al, 0x77c6(%rip)       # 0xa2f9
movzbl %al, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x36a2
xorl %edi, %edi
callq 0x42d7
movb $0x0, 0x77aa(%rip)      # 0xa2f9
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lupyuen[P]lora-sx1262/src/radio.c
// Function: RadioIsChannelFree
bool RadioIsChannelFree( uint32_t freq, uint32_t rxBandwidth, int16_t rssiThresh, uint32_t maxCarrierSenseTime )
{
    printf("RadioIsChannelFree: freq=%d, rxBandwidth=%d\r\n", (int) freq, (int) rxBandwidth);
    bool     status           = true;
    int16_t  rssi             = 0;
    uint32_t carrierSenseTime = 0;

    RadioSetModem( MODEM_FSK );

    RadioSetChannel( freq );

    // Set Rx bandwidth. Other parameters are not used.
    RadioSetRxConfig( MODEM_FSK, rxBandwidth, 600, 0, rxBandwidth, 3, 0, false,
                      0, false, 0, 0, false, true );
    RadioRx( 0 );

    DelayMs( 1 );

    carrierSenseTime = TimerGetCurrentTime( );
    printf("RadioIsChannelFree: carrierSenseTime=%d, elapsed=%d, maxCarrierSenseTime=%d\r\n", (int) carrierSenseTime, (int) TimerGetElapsedTime( carrierSenseTime ), (int) maxCarrierSenseTime);

    // Perform carrier sense for maxCarrierSenseTime
    while( TimerGetElapsedTime( carrierSenseTime ) < maxCarrierSenseTime )
    {
        rssi = RadioRssi( MODEM_FSK );

        if( rssi > rssiThresh )
        {
            status = false;
            break;
        }
    }
    RadioSleep( );
    printf("RadioIsChannelFree done\r\n");
    return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %r14d
movl %esi, %r15d
movl %edi, %r12d
leaq 0x36a7(%rip), %rdi      # 0x6242
xorl %r13d, %r13d
movl %r12d, %esi
movl %r15d, %edx
xorl %eax, %eax
callq 0x2050
leaq 0x399d(%rip), %rdi      # 0x654f
callq 0x2260
xorl %edi, %edi
callq 0x42d7
movb $0x0, 0x7734(%rip)      # 0xa2f9
leaq 0x365b(%rip), %rdi      # 0x6227
movl %r12d, %esi
xorl %eax, %eax
callq 0x2050
movl %r12d, %edi
callq 0x425b
xorl %edi, %edi
movl %r15d, %esi
movl $0x258, %edx            # imm = 0x258
xorl %ecx, %ecx
movl $0x3, %r9d
pushq $0x1
pushq %r13
pushq %r13
pushq %r13
pushq %r13
pushq %r13
pushq %r13
pushq %r13
callq 0x2ca4
addq $0x40, %rsp
xorl %edi, %edi
callq 0x3578
movl $0x1, %edi
callq 0x5089
callq 0x50a0
movl %eax, %r15d
movl %eax, %edi
callq 0x50c3
leaq 0x3640(%rip), %rdi      # 0x6270
movl %r15d, %esi
movl %eax, %edx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x2050
movl %r15d, %edi
callq 0x50c3
movl %eax, %r12d
cmpl %ebx, %eax
jae 0x2c5b
callq 0x46ec
movsbl %al, %eax
cmpw %r14w, %ax
jle 0x2c3e
cmpl %ebx, %r12d
setae %bl
callq 0x353b
leaq 0x38f1(%rip), %rdi      # 0x655e
callq 0x2260
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lupyuen[P]lora-sx1262/src/radio.c
// Function: RadioSend
void RadioSend( uint8_t *buffer, uint8_t size )
{
    printf("RadioSend: size=%d\r\n", (int) size);
    for (int i = 0; i < size; i++) {
        printf("%02x ", buffer[i]);
    }
    printf("\r\n");

    SX126xSetDioIrqParams( IRQ_TX_DONE | IRQ_RX_TX_TIMEOUT,
                           IRQ_TX_DONE | IRQ_RX_TX_TIMEOUT,
                           IRQ_RADIO_NONE,
                           IRQ_RADIO_NONE );

    if( SX126xGetPacketType( ) == PACKET_TYPE_LORA )
    {
        SX126x.PacketParams.Params.LoRa.PayloadLength = size;
    }
    else
    {
        SX126x.PacketParams.Params.Gfsk.PayloadLength = size;
    }

    //// TODO
    printf("RadioSend: PreambleLength=%d, HeaderType=%d, PayloadLength=%d, CrcMode=%d, InvertIQ=%d\r\n", (int) SX126x.PacketParams.Params.LoRa.PreambleLength, (int) SX126x.PacketParams.Params.LoRa.HeaderType, (int) SX126x.PacketParams.Params.LoRa.PayloadLength, (int) SX126x.PacketParams.Params.LoRa.CrcMode, (int) SX126x.PacketParams.Params.LoRa.InvertIQ); //// TODO

    SX126xSetPacketParams( &SX126x.PacketParams );

    SX126xSendPayload( buffer, size, 0 );
    TimerStart( &TxTimeoutTimer, TxTimeout );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r15d
movq %rdi, %rbx
leaq 0x2fb0(%rip), %rdi      # 0x641b
xorl %eax, %eax
callq 0x2050
movzbl %r15b, %r14d
testl %r15d, %r15d
je 0x349c
leaq 0x2bfa(%rip), %r15      # 0x607c
xorl %r12d, %r12d
movzbl (%rbx,%r12), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x2050
incq %r12
cmpq %r12, %r14
jne 0x3485
leaq 0x2c1a(%rip), %rdi      # 0x60bd
callq 0x2260
movl $0x201, %edi            # imm = 0x201
movl $0x201, %esi            # imm = 0x201
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x4199
callq 0x3d0a
cmpl $0x1, %eax
leaq 0x6e52(%rip), %rax      # 0xa31c
leaq 0x6e5f(%rip), %rcx      # 0xa330
cmovneq %rax, %rcx
movb %r14b, (%rcx)
movzwl 0x6e49(%rip), %esi      # 0xa328
movl 0x6e47(%rip), %edx      # 0xa32c
movzbl 0x6e44(%rip), %ecx      # 0xa330
movl 0x6e41(%rip), %r8d      # 0xa334
movl 0x6e3e(%rip), %r9d      # 0xa338
leaq 0x2f2f(%rip), %rdi      # 0x6430
xorl %eax, %eax
callq 0x2050
leaq 0x6df5(%rip), %rdi      # 0xa304
callq 0x44d1
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x3c64
movl 0x6d09(%rip), %esi      # 0xa230
leaq 0x6d5a(%rip), %rdi      # 0xa288
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5004
// File: /workspace/github_c_makefile_star2_O1/lupyuen[P]lora-sx1262/src/radio.c
// Function: RadioRx
void RadioRx( uint32_t timeout )
{
    printf("RadioRx\r\n");
    SX126xSetDioIrqParams( IRQ_RADIO_ALL, //IRQ_RX_DONE | IRQ_RX_TX_TIMEOUT,
                           IRQ_RADIO_ALL, //IRQ_RX_DONE | IRQ_RX_TX_TIMEOUT,
                           IRQ_RADIO_NONE,
                           IRQ_RADIO_NONE );

    if( timeout != 0 )
    {
        TimerStart( &RxTimeoutTimer, timeout );
    }

    if( RxContinuous == true )
    {
        SX126xSetRx( 0xFFFFFF ); // Rx Continuous
    }
    else
    {
        SX126xSetRx( RxTimeout << 6 );
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x3033(%rip), %rdi      # 0x65ba
callq 0x2260
movl $0xffff, %edi           # imm = 0xFFFF
movl $0xffff, %esi           # imm = 0xFFFF
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x4199
testl %ebx, %ebx
je 0x35b1
leaq 0x6d16(%rip), %rdi      # 0xa2c0
movl %ebx, %esi
callq 0x5004
movl 0x6c7d(%rip), %eax      # 0xa234
shll $0x6, %eax
cmpb $0x0, 0x6c77(%rip)      # 0xa238
movl $0xffffff, %edi         # imm = 0xFFFFFF
cmovel %eax, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3e28
// File: /workspace/github_c_makefile_star2_O1/lupyuen[P]lora-sx1262/src/radio.c
// Function: RadioSetTxContinuousWave
void RadioSetTxContinuousWave( uint32_t freq, int8_t power, uint16_t time )
{
    uint32_t timeout = ( uint32_t )time * 1000;

    SX126xSetRfFrequency( freq );
    SX126xSetRfTxPower( power );
    SX126xSetTxContinuousWave( );

    TimerStart( &TxTimeoutTimer, timeout );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
imull $0x3e8, %edx, %r14d     # imm = 0x3E8
callq 0x425b
movl %ebx, %edi
callq 0x4ecf
callq 0x3f7d
leaq 0x6c6f(%rip), %rdi      # 0xa288
movl %r14d, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x5004
// File: /workspace/github_c_makefile_star2_O1/lupyuen[P]lora-sx1262/src/radio.c
// Function: RadioSetPublicNetwork
void RadioSetPublicNetwork( bool enable )
{
    RadioPublicNetwork.Current = RadioPublicNetwork.Previous = enable;

    RadioSetModem( MODEM_LORA );
    if( enable == true )
    {
        printf("RadioSetPublicNetwork: public syncword=%x\r\n", LORA_MAC_PUBLIC_SYNCWORD); //// TODO
        // Change LoRa modem SyncWord
        SX126xWriteRegister( REG_LR_SYNCWORD, ( LORA_MAC_PUBLIC_SYNCWORD >> 8 ) & 0xFF );
        SX126xWriteRegister( REG_LR_SYNCWORD + 1, LORA_MAC_PUBLIC_SYNCWORD & 0xFF );
    }
    else
    {
        printf("RadioSetPublicNetwork: private syncword=%x\r\n", LORA_MAC_PRIVATE_SYNCWORD); //// TODO
        // Change LoRa modem SyncWord
        SX126xWriteRegister( REG_LR_SYNCWORD, ( LORA_MAC_PRIVATE_SYNCWORD >> 8 ) & 0xFF );
        SX126xWriteRegister( REG_LR_SYNCWORD + 1, LORA_MAC_PRIVATE_SYNCWORD & 0xFF );
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
movb %bl, 0x6c48(%rip)       # 0xa2f8
movb %bl, 0x6c43(%rip)       # 0xa2f9
movl $0x1, %edi
callq 0x2afc
testl %ebx, %ebx
je 0x36dd
leaq 0x2dbe(%rip), %rdi      # 0x6489
movl $0x3444, %esi           # imm = 0x3444
xorl %eax, %eax
callq 0x2050
movb $0x44, %bl
movb $0x34, %al
jmp 0x36f4
leaq 0x2dd1(%rip), %rdi      # 0x64b5
movl $0x1424, %esi           # imm = 0x1424
xorl %eax, %eax
callq 0x2050
movb $0x24, %bl
movb $0x14, %al
movzbl %al, %esi
movl $0x740, %edi            # imm = 0x740
callq 0x4d78
movzbl %bl, %esi
movl $0x741, %edi            # imm = 0x741
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x4d78
// File: /workspace/github_c_makefile_star2_O1/lupyuen[P]lora-sx1262/src/radio.c
// Function: RadioRxBoosted
void RadioRxBoosted( uint32_t timeout )
{
    SX126xSetDioIrqParams( IRQ_RADIO_ALL, //IRQ_RX_DONE | IRQ_RX_TX_TIMEOUT,
                           IRQ_RADIO_ALL, //IRQ_RX_DONE | IRQ_RX_TX_TIMEOUT,
                           IRQ_RADIO_NONE,
                           IRQ_RADIO_NONE );

    if( timeout != 0 )
    {
        TimerStart( &RxTimeoutTimer, timeout );
    }

    if( RxContinuous == true )
    {
        SX126xSetRxBoosted( 0xFFFFFF ); // Rx Continuous
    }
    else
    {
        SX126xSetRxBoosted( RxTimeout << 6 );
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
movl $0xffff, %edi           # imm = 0xFFFF
movl $0xffff, %esi           # imm = 0xFFFF
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x4199
testl %ebx, %ebx
je 0x39a9
leaq 0x691e(%rip), %rdi      # 0xa2c0
movl %ebx, %esi
callq 0x5004
movl 0x6885(%rip), %eax      # 0xa234
shll $0x6, %eax
cmpb $0x0, 0x687f(%rip)      # 0xa238
movl $0xffffff, %edi         # imm = 0xFFFFFF
cmovel %eax, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3ece