	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fileargs_get_fd_cache
_fileargs_get_fd_cache:                 ## @fileargs_get_fd_cache
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	xorl	%edi, %edi
	testq	%rbx, %rbx
	setne	%dil
	callq	_assert
	movq	(%rbx), %rax
	movq	_FILEARGS_MAGIC@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_assert
	xorl	%edi, %edi
	testq	%r15, %r15
	setne	%dil
	callq	_assert
	movq	16(%rbx), %rdi
	movl	$-1, %r14d
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	_O_CREAT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_3
LBB0_2:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_dnvlist_get_nvlist
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movq	16(%rbx), %rdi
	movq	%r15, %rsi
	callq	_nvlist_take_nvlist
	movq	%rax, %r12
	leaq	L_.str(%rip), %rsi
	movq	%rax, %rdi
	callq	_nvlist_exists_descriptor
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_nvlist_take_descriptor
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_nvlist_destroy
	movl	8(%rbx), %edx
	movq	_O_CLOEXEC@GOTPCREL(%rip), %rax
	movl	%edx, %ecx
	notl	%ecx
	testl	%ecx, (%rax)
	je	LBB0_6
## %bb.8:
	movq	_F_SETFD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	callq	_fcntl
	cmpl	$-1, %eax
	je	LBB0_10
LBB0_6:
	movl	%r15d, %r14d
	jmp	LBB0_2
LBB0_7:
	movq	%r12, %rdi
	callq	_nvlist_destroy
	jmp	LBB0_2
LBB0_10:
	movl	%r15d, %edi
	callq	_close
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_FILEARGS_MAGIC,8,3             ## @FILEARGS_MAGIC
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fd"

	.comm	_O_CLOEXEC,4,2                  ## @O_CLOEXEC
	.comm	_F_SETFD,4,2                    ## @F_SETFD
	.no_dead_strip	_fileargs_get_fd_cache
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fileargs_get_fd_cache
_fileargs_get_fd_cache:                 ; @fileargs_get_fd_cache
	.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	x20, x1
	mov	x19, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _FILEARGS_MAGIC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FILEARGS_MAGIC@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_assert
	cmp	x20, #0
	cset	w0, ne
	bl	_assert
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w8, [x19, #8]
Lloh3:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
LBB0_2:
	mov	w20, #-1
LBB0_3:
	mov	x0, x20
	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
LBB0_4:
	mov	x1, x20
	mov	x2, #0
	bl	_dnvlist_get_nvlist
	cbz	x0, LBB0_2
; %bb.5:
	ldr	x0, [x19, #16]
	mov	x1, x20
	bl	_nvlist_take_nvlist
	mov	x21, x0
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_nvlist_exists_descriptor
	cbz	w0, LBB0_9
; %bb.6:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_nvlist_take_descriptor
	mov	x20, x0
	mov	x0, x21
	bl	_nvlist_destroy
	ldr	w2, [x19, #8]
Lloh10:
	adrp	x8, _O_CLOEXEC@GOTPAGE
Lloh11:
	ldr	x8, [x8, _O_CLOEXEC@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	bics	wzr, w8, w2
	b.eq	LBB0_3
; %bb.7:
Lloh13:
	adrp	x8, _F_SETFD@GOTPAGE
Lloh14:
	ldr	x8, [x8, _F_SETFD@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_fcntl
	cmn	w0, #1
	b.ne	LBB0_3
; %bb.8:
	mov	x0, x20
	bl	_close
	b	LBB0_2
LBB0_9:
	mov	x0, x21
	bl	_nvlist_destroy
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_FILEARGS_MAGIC,8,3             ; @FILEARGS_MAGIC
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fd"

	.comm	_O_CLOEXEC,4,2                  ; @O_CLOEXEC
	.comm	_F_SETFD,4,2                    ; @F_SETFD
	.no_dead_strip	_fileargs_get_fd_cache
.subsections_via_symbols
