	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function test_wired_copy_on_write
_test_wired_copy_on_write:              ## @test_wired_copy_on_write
	.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	%rsi, %r15
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	_fork
	movl	%eax, %r13d
	cmpl	$-1, %eax
	je	LBB0_7
## %bb.1:
	testl	%r13d, %r13d
	jne	LBB0_8
## %bb.2:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_mlock
	testq	%rax, %rax
	jne	LBB0_9
## %bb.3:
	movq	_PT_TRACE_ME@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_ptrace
	testl	%eax, %eax
	jne	LBB0_10
## %bb.4:
	movq	_SIGSTOP@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_raise
	testq	%rax, %rax
	jne	LBB0_11
## %bb.5:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_munlock
	testq	%rax, %rax
	jne	LBB0_12
## %bb.6:
	xorl	%edi, %edi
	callq	__exit
LBB0_7:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_strerror
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_atf_tc_fail
LBB0_8:
	leaq	-44(%rbp), %r12
	movl	%r13d, %edi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_waitpid
	xorl	%edi, %edi
	cmpl	%r13d, %eax
	sete	%dil
	callq	_ATF_REQUIRE
	movl	-44(%rbp), %edi
	callq	_WIFEXITED
	xorl	%ebx, %ebx
	testl	%eax, %eax
	sete	%bl
	movl	-44(%rbp), %edi
	callq	_WEXITSTATUS
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	movq	%rax, %rdx
	callq	_ATF_REQUIRE_MSG
	movl	-44(%rbp), %edi
	callq	_WIFSTOPPED
	movl	%eax, %edi
	callq	_ATF_REQUIRE
	movl	-44(%rbp), %edi
	callq	_WSTOPSIG
	movq	_SIGSTOP@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_ATF_REQUIRE
	movq	_errno@GOTPCREL(%rip), %r15
	movq	$0, (%r15)
	movq	_PT_READ_D@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r13d, %esi
	movq	%r14, %rdx
	xorl	%ecx, %ecx
	callq	_ptrace
	movl	%eax, %ebx
	xorl	%edi, %edi
	cmpq	$0, (%r15)
	sete	%dil
	callq	_ATF_REQUIRE
	movq	_PT_WRITE_D@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r13d, %esi
	movq	%r14, %rdx
	movl	%ebx, %ecx
	callq	_ptrace
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_ATF_REQUIRE
	movq	_PT_CONTINUE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %edx
	movl	%r13d, %esi
	xorl	%ecx, %ecx
	callq	_ptrace
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_ATF_REQUIRE
	movl	%r13d, %edi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_waitpid
	xorl	%edi, %edi
	cmpl	%r13d, %eax
	sete	%dil
	callq	_ATF_REQUIRE
	movl	-44(%rbp), %edi
	callq	_WIFEXITED
	movl	%eax, %edi
	callq	_ATF_REQUIRE
	movl	-44(%rbp), %edi
	callq	_WEXITSTATUS
	xorl	%ebx, %ebx
	testq	%rax, %rax
	sete	%bl
	movl	-44(%rbp), %edi
	callq	_WSTOPSIG
	movl	%ebx, %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%rax, %rdx
	callq	_ATF_REQUIRE_MSG
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	$1, %edi
	callq	__exit
LBB0_10:
	movl	$2, %edi
	callq	__exit
LBB0_11:
	movl	$3, %edi
	callq	__exit
LBB0_12:
	movl	$4, %edi
	callq	__exit
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fork() failed: %s"

	.comm	_errno,8,3                      ## @errno
	.comm	_PT_TRACE_ME,4,2                ## @PT_TRACE_ME
	.comm	_SIGSTOP,8,3                    ## @SIGSTOP
L_.str.1:                               ## @.str.1
	.asciz	"child exited with status %d"

	.comm	_PT_READ_D,4,2                  ## @PT_READ_D
	.comm	_PT_WRITE_D,4,2                 ## @PT_WRITE_D
	.comm	_PT_CONTINUE,4,2                ## @PT_CONTINUE
	.no_dead_strip	_test_wired_copy_on_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function test_wired_copy_on_write
_test_wired_copy_on_write:              ; @test_wired_copy_on_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x1
	mov	x19, x0
	bl	_fork
	mov	x20, x0
Lloh0:
	adrp	x23, _errno@GOTPAGE
Lloh1:
	ldr	x23, [x23, _errno@GOTPAGEOFF]
	cmn	w0, #1
	b.eq	LBB0_8
; %bb.1:
	cbnz	w20, LBB0_9
; %bb.2:
	mov	x0, x19
	mov	x1, x21
	bl	_mlock
	cbnz	x0, LBB0_10
; %bb.3:
Lloh2:
	adrp	x8, _PT_TRACE_ME@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PT_TRACE_ME@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	mov	w1, #0
	mov	x2, #0
	mov	w3, #0
	bl	_ptrace
	cbnz	w0, LBB0_11
; %bb.4:
Lloh5:
	adrp	x8, _SIGSTOP@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SIGSTOP@GOTPAGEOFF]
Lloh7:
	ldr	x0, [x8]
	bl	_raise
	cbnz	x0, LBB0_12
; %bb.5:
	mov	x0, x19
	mov	x1, x21
	bl	_munlock
	cbz	x0, LBB0_7
; %bb.6:
	mov	w0, #4
LBB0_7:
	bl	__exit
LBB0_8:
	ldr	x0, [x23]
	bl	_strerror
	mov	x1, x0
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_atf_tc_fail
LBB0_9:
	add	x1, sp, #12
	mov	x0, x20
	mov	w2, #0
	bl	_waitpid
	cmp	w0, w20
	cset	w0, eq
	bl	_ATF_REQUIRE
	ldr	w0, [sp, #12]
	bl	_WIFEXITED
	cmp	w0, #0
	cset	w22, eq
	ldr	w0, [sp, #12]
	bl	_WEXITSTATUS
	mov	x2, x0
Lloh10:
	adrp	x21, l_.str.1@PAGE
Lloh11:
	add	x21, x21, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	x1, x21
	bl	_ATF_REQUIRE_MSG
	ldr	w0, [sp, #12]
	bl	_WIFSTOPPED
	bl	_ATF_REQUIRE
	ldr	w0, [sp, #12]
	bl	_WSTOPSIG
Lloh12:
	adrp	x8, _SIGSTOP@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SIGSTOP@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cmp	x0, x8
	cset	w0, eq
	bl	_ATF_REQUIRE
	str	xzr, [x23]
Lloh15:
	adrp	x8, _PT_READ_D@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PT_READ_D@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	mov	x1, x20
	mov	x2, x19
	mov	w3, #0
	bl	_ptrace
	mov	x22, x0
	ldr	x8, [x23]
	cmp	x8, #0
	cset	w0, eq
	bl	_ATF_REQUIRE
Lloh18:
	adrp	x8, _PT_WRITE_D@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PT_WRITE_D@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	mov	x1, x20
	mov	x2, x19
	mov	x3, x22
	bl	_ptrace
	cmp	w0, #0
	cset	w0, eq
	bl	_ATF_REQUIRE
Lloh21:
	adrp	x8, _PT_CONTINUE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _PT_CONTINUE@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	mov	x1, x20
	mov	w2, #1
	mov	w3, #0
	bl	_ptrace
	cmp	w0, #0
	cset	w0, eq
	bl	_ATF_REQUIRE
	add	x1, sp, #12
	mov	x0, x20
	mov	w2, #0
	bl	_waitpid
	cmp	w0, w20
	cset	w0, eq
	bl	_ATF_REQUIRE
	ldr	w0, [sp, #12]
	bl	_WIFEXITED
	bl	_ATF_REQUIRE
	ldr	w0, [sp, #12]
	bl	_WEXITSTATUS
	cmp	x0, #0
	cset	w19, eq
	ldr	w0, [sp, #12]
	bl	_WSTOPSIG
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_ATF_REQUIRE_MSG
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_10:
	mov	w0, #1
	bl	__exit
LBB0_11:
	mov	w0, #2
	bl	__exit
LBB0_12:
	mov	w0, #3
	bl	__exit
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fork() failed: %s"

	.comm	_errno,8,3                      ; @errno
	.comm	_PT_TRACE_ME,4,2                ; @PT_TRACE_ME
	.comm	_SIGSTOP,8,3                    ; @SIGSTOP
l_.str.1:                               ; @.str.1
	.asciz	"child exited with status %d"

	.comm	_PT_READ_D,4,2                  ; @PT_READ_D
	.comm	_PT_WRITE_D,4,2                 ; @PT_WRITE_D
	.comm	_PT_CONTINUE,4,2                ; @PT_CONTINUE
	.no_dead_strip	_test_wired_copy_on_write
.subsections_via_symbols
