#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__APPLE__)
#if defined(__amd64__)

	.section .text

	.globl	_start
	.type	_start, @function
_start:
	mov	%rdi, %rax
	and	$0xfffffffffffffff0, %rsp

	mov	(%rax), %rdi		/* argc */
	movslq	%edi, %rdi		/* argc */
	lea	0x8(%rax), %rsi		/* argv */
	lea	(%rsi, %rdi, 8), %rdx	/* envp */
	add	$0x8, %rdx		/* envp */

	callq	nlcrt_start

	hlt
#endif
#endif
