# clock_gettime64 needed for 32 bits without sign bit
	.section	.text
	.intel_syntax
	.global	clock_gettime
clock_gettime:
	push	%ebp
	mov	%ebp, %esp
	push	%ebx
	sub	%esp, 24		# Allocate space for a record
	lea	%ecx, [%ebp - 20]	# Store local record address in %ecx
	mov	%ebx, [%ebp + 8]	# Clock ID
	mov	%eax, 403		# clock_gettime64 system call
	int	128
	mov	%edx, [%ebp + 12]	# %edx = remote record address
	mov	%ecx, [%ebp - 20]	# %ecx = ts.sec
	mov	[%edx], %ecx		# Store it in remote record
	mov	%ecx, [%ebp - 12]	# %ecx = ts.nsec
	mov	[%edx + 4], %ecx	# Store it in remote record
	pop	%ebx
	mov	%esp, %ebp		# Deallocate space
	pop	%ebp
	ret
