	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tfhremove
_tfhremove:                             ## @tfhremove
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_rump_sys_chdir
	movl	%eax, %edi
	callq	_RL
	movq	_FNAME@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movl	$511, %edx                      ## imm = 0x1FF
	callq	_rump_sys_open
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_RL
	movl	%ebx, %edi
	callq	_rump_sys_close
	movl	%eax, %edi
	callq	_RL
	movq	$0, -40(%rbp)
	movl	(%r12), %edi
	leaq	-40(%rbp), %rdx
	xorl	%esi, %esi
	callq	_rump_sys_getfh
	cmpl	$-1, %eax
	jne	LBB0_5
## %bb.1:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_atf_tc_skip
	jmp	LBB0_5
LBB0_3:
	movq	_E2BIG@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	callq	_atf_tc_fail_errno
LBB0_5:
	movq	-40(%rbp), %rdi
	callq	_malloc
	movq	%rax, %r15
	movl	(%r12), %edi
	leaq	-40(%rbp), %rdx
	movq	%rax, %rsi
	callq	_rump_sys_getfh
	movl	%eax, %edi
	callq	_RL
	movl	(%r12), %edi
	callq	_rump_sys_unlink
	movl	%eax, %edi
	callq	_RL
	movq	%r14, %rdi
	callq	_FSTYPE_LFS
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.2(%rip), %rdi
	callq	_atf_tc_expect_fail
LBB0_7:
	movq	_ESTALE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	-40(%rbp), %rsi
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_rump_sys_fhopen
	xorl	%esi, %esi
	cmpl	$-1, %eax
	sete	%sil
	movl	%ebx, %edi
	callq	_ATF_REQUIRE_ERRNO
	xorl	%eax, %eax
	callq	_atf_tc_expect_pass
	leaq	L_.str.3(%rip), %rdi
	callq	_rump_sys_chdir
	movl	%eax, %edi
	callq	_RL
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FNAME,4,2                      ## @FNAME
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_errno,8,3                      ## @errno
	.comm	_EOPNOTSUPP,8,3                 ## @EOPNOTSUPP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"file handles not supported"

	.comm	_E2BIG,8,3                      ## @E2BIG
L_.str.1:                               ## @.str.1
	.asciz	"getfh size"

L_.str.2:                               ## @.str.2
	.asciz	"fhopen() for removed file succeeds (PR kern/43745)"

	.comm	_ESTALE,4,2                     ## @ESTALE
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
L_.str.3:                               ## @.str.3
	.asciz	"/"

	.no_dead_strip	_tfhremove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tfhremove
_tfhremove:                             ; @tfhremove
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
	mov	x0, x1
	bl	_rump_sys_chdir
	bl	_RL
Lloh0:
	adrp	x21, _FNAME@GOTPAGE
Lloh1:
	ldr	x21, [x21, _FNAME@GOTPAGEOFF]
Lloh2:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	w2, #511
	bl	_rump_sys_open
	mov	x20, x0
	bl	_RL
	mov	x0, x20
	bl	_rump_sys_close
	bl	_RL
	str	xzr, [sp, #8]
	ldr	w0, [x21]
	add	x2, sp, #8
	mov	x1, #0
	bl	_rump_sys_getfh
	cmn	w0, #1
	b.ne	LBB0_5
; %bb.1:
Lloh8:
	adrp	x8, _errno@GOTPAGE
Lloh9:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _EOPNOTSUPP@GOTPAGE
Lloh12:
	ldr	x9, [x9, _EOPNOTSUPP@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_atf_tc_skip
	b	LBB0_5
LBB0_3:
Lloh16:
	adrp	x9, _E2BIG@GOTPAGE
Lloh17:
	ldr	x9, [x9, _E2BIG@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.4:
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_atf_tc_fail_errno
LBB0_5:
	ldr	x0, [sp, #8]
	bl	_malloc
	mov	x20, x0
	ldr	w0, [x21]
	add	x2, sp, #8
	mov	x1, x20
	bl	_rump_sys_getfh
	bl	_RL
	ldr	w0, [x21]
	bl	_rump_sys_unlink
	bl	_RL
	mov	x0, x19
	bl	_FSTYPE_LFS
	cbz	x0, LBB0_7
; %bb.6:
Lloh21:
	adrp	x0, l_.str.2@PAGE
Lloh22:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_atf_tc_expect_fail
LBB0_7:
Lloh23:
	adrp	x8, _ESTALE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ESTALE@GOTPAGEOFF]
Lloh25:
	ldr	w19, [x8]
	ldr	x1, [sp, #8]
Lloh26:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh27:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_rump_sys_fhopen
	cmn	w0, #1
	cset	w1, eq
	mov	x0, x19
	bl	_ATF_REQUIRE_ERRNO
	bl	_atf_tc_expect_pass
Lloh29:
	adrp	x0, l_.str.3@PAGE
Lloh30:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_rump_sys_chdir
	bl	_RL
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_FNAME,4,2                      ; @FNAME
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_errno,8,3                      ; @errno
	.comm	_EOPNOTSUPP,8,3                 ; @EOPNOTSUPP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"file handles not supported"

	.comm	_E2BIG,8,3                      ; @E2BIG
l_.str.1:                               ; @.str.1
	.asciz	"getfh size"

l_.str.2:                               ; @.str.2
	.asciz	"fhopen() for removed file succeeds (PR kern/43745)"

	.comm	_ESTALE,4,2                     ; @ESTALE
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
l_.str.3:                               ; @.str.3
	.asciz	"/"

	.no_dead_strip	_tfhremove
.subsections_via_symbols
