	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cpu_fork                       ## -- Begin function cpu_fork
	.p2align	4, 0x90
_cpu_fork:                              ## @cpu_fork
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	_curthread@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	sete	%al
	cmpq	_thread0@GOTPCREL(%rip), %rdi
	movl	%ecx, %r15d
	movq	%rdx, %r14
	movq	%rsi, %r12
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	_KTR_PROC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdx
	movq	%r12, %rcx
	movl	%r15d, %r8d
	callq	_CTR3
	movq	_RFPROC@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_2
## %bb.1:
	movslq	(%r14), %rax
	movslq	4(%r14), %rcx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rdx
	imulq	%rcx, %rdx
	leaq	(%rdx,%rax), %rbx
	addq	$-48, %rbx
	andq	$-48, %rbx
	movq	%rbx, 24(%r14)
	movq	24(%r13), %rax
	movups	(%rax), %xmm0
	movups	16(%rax), %xmm1
	movups	32(%rax), %xmm2
	movups	%xmm2, 32(%rbx)
	movups	%xmm1, 16(%rbx)
	movups	%xmm0, (%rbx)
	movq	16(%r13), %rax
	movups	(%rax), %xmm0
	movups	16(%rax), %xmm1
	movups	32(%rax), %xmm2
	movups	%xmm2, -16(%rbx)
	movups	%xmm1, -32(%rbx)
	movups	%xmm0, -48(%rbx)
	movq	-8(%rbx), %rax
	movq	_FIRSTARG@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	$0, (%rax,%rdx,8)
	movq	(%rcx), %rcx
	movq	$0, 8(%rax,%rcx,8)
	andb	$-17, -45(%rbx)
	leaq	-48(%rbx), %r12
	movq	%r12, 16(%r14)
	leaq	-80(%rbx), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	_fork_return@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbx)
	movq	%r14, -72(%rbx)
	movq	%r12, -80(%rbx)
	movl	%r15d, 4(%rbx)
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	callq	_KASSERT
	movq	_fork_trampoline@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rbx)
	movq	24(%rbx), %rcx
	movq	%rax, (%rcx)
	movl	$1, 8(%r14)
	movq	_psl_kernset@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r14)
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_curthread,8,3                  ## @curthread
	.comm	_thread0,32,3                   ## @thread0
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cpu_fork: p1 not curproc and not proc0"

	.comm	_KTR_PROC,4,2                   ## @KTR_PROC
L_.str.1:                               ## @.str.1
	.asciz	"cpu_fork: called td1=%p p2=%p flags=%x"

	.comm	_RFPROC,4,2                     ## @RFPROC
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_FIRSTARG,8,3                   ## @FIRSTARG
	.comm	_fork_return,8,3                ## @fork_return
L_.str.2:                               ## @.str.2
	.asciz	"stack misaligned"

	.comm	_fork_trampoline,8,3            ## @fork_trampoline
	.comm	_psl_kernset,4,2                ## @psl_kernset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cpu_fork                       ; -- Begin function cpu_fork
	.p2align	2
_cpu_fork:                              ; @cpu_fork
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x21, x3
	mov	x19, x2
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _curthread@GOTPAGE
Lloh1:
	ldr	x8, [x8, _curthread@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _thread0@GOTPAGE
Lloh4:
	ldr	x9, [x9, _thread0@GOTPAGEOFF]
	cmp	x0, x9
	ccmp	x8, x0, #4, ne
	cset	w0, eq
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
Lloh7:
	adrp	x8, _KTR_PROC@GOTPAGE
Lloh8:
	ldr	x8, [x8, _KTR_PROC@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	mov	x3, x22
	mov	x4, x21
	bl	_CTR3
Lloh12:
	adrp	x8, _RFPROC@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RFPROC@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_2
; %bb.1:
Lloh15:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
	ldpsw	x9, x10, [x19]
Lloh17:
	ldrsw	x8, [x8]
	madd	x8, x8, x10, x9
	sub	x8, x8, #48
	mov	x9, #-48
	and	x21, x8, x9
	str	x21, [x19, #24]
	ldr	x8, [x20, #24]
	ldp	q0, q1, [x8]
	ldr	q2, [x8, #32]
	stp	q1, q2, [x21, #16]
	str	q0, [x21]
	sub	x22, x21, #48
	ldr	x8, [x20, #16]
	ldp	q0, q1, [x8]
	ldr	q2, [x8, #32]
	stp	q1, q2, [x21, #-32]
	stur	q0, [x21, #-48]
Lloh18:
	adrp	x8, _FIRSTARG@GOTPAGE
Lloh19:
	ldr	x8, [x8, _FIRSTARG@GOTPAGEOFF]
	ldur	x9, [x21, #-8]
	ldr	x10, [x8]
	str	xzr, [x9, x10, lsl #3]
	ldr	x8, [x8]
	add	x8, x9, x8, lsl #3
	str	xzr, [x8, #8]
	ldur	w8, [x21, #-48]
	and	w8, w8, #0xefffffff
	stur	w8, [x21, #-48]
	str	x22, [x19, #16]
	sub	x20, x21, #80
	mov	x0, x20
	mov	w1, #0
	mov	w2, #32
	bl	_memset
Lloh20:
	adrp	x8, _fork_return@GOTPAGE
Lloh21:
	ldr	x8, [x8, _fork_return@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	stp	x19, x8, [x21, #-72]
	stur	x22, [x21, #-80]
	str	w20, [x21, #4]
Lloh23:
	adrp	x1, l_.str.2@PAGE
Lloh24:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w20, #1
	mov	w0, #1
	bl	_KASSERT
Lloh25:
	adrp	x8, _fork_trampoline@GOTPAGE
Lloh26:
	ldr	x8, [x8, _fork_trampoline@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	str	x8, [x21, #16]
	ldr	x9, [x21, #24]
	str	x8, [x9]
Lloh28:
	adrp	x8, _psl_kernset@GOTPAGE
Lloh29:
	ldr	x8, [x8, _psl_kernset@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	stp	w20, w8, [x19, #8]
LBB0_2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_curthread,8,3                  ; @curthread
	.comm	_thread0,32,3                   ; @thread0
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cpu_fork: p1 not curproc and not proc0"

	.comm	_KTR_PROC,4,2                   ; @KTR_PROC
l_.str.1:                               ; @.str.1
	.asciz	"cpu_fork: called td1=%p p2=%p flags=%x"

	.comm	_RFPROC,4,2                     ; @RFPROC
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_FIRSTARG,8,3                   ; @FIRSTARG
	.comm	_fork_return,8,3                ; @fork_return
l_.str.2:                               ; @.str.2
	.asciz	"stack misaligned"

	.comm	_fork_trampoline,8,3            ; @fork_trampoline
	.comm	_psl_kernset,4,2                ; @psl_kernset
.subsections_via_symbols
