	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fd_close
_fd_close:                              ## @fd_close
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rdi), %edx
	testl	%edx, %edx
	js	LBB0_7
## %bb.1:
	movq	%rdi, %rbx
	movq	_errno@GOTPCREL(%rip), %r14
	movq	_EINTR@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%edx, %edi
	callq	_close
	testq	%rax, %rax
	jns	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r14), %rax
	movl	(%rbx), %edx
	cmpq	(%r15), %rax
	je	LBB0_2
## %bb.4:
	leaq	L_.str(%rip), %rsi
	movl	$2, %edi
	jmp	LBB0_5
LBB0_7:
	leaq	L_.str.2(%rip), %rsi
	movl	$3, %edi
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vkprintf                       ## TAILCALL
LBB0_6:
	movq	_fd_close_success_level@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%rbx), %edx
	leaq	L_.str.1(%rip), %rsi
	callq	_vkprintf
	movl	$-1, (%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,8,3                      ## @errno
	.comm	_EINTR,8,3                      ## @EINTR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"close (%d) failed. %m\n"

	.comm	_fd_close_success_level,4,2     ## @fd_close_success_level
L_.str.1:                               ## @.str.1
	.asciz	"fd = %d: was successfully closed.\n"

L_.str.2:                               ## @.str.2
	.asciz	"skip closing negative fd = %d\n"

	.no_dead_strip	_fd_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fd_close
_fd_close:                              ; @fd_close
	.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
	ldr	w2, [x0]
	tbnz	w2, #31, LBB0_5
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x20, _errno@GOTPAGE
Lloh1:
	ldr	x20, [x20, _errno@GOTPAGEOFF]
Lloh2:
	adrp	x21, _EINTR@GOTPAGE
Lloh3:
	ldr	x21, [x21, _EINTR@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x2
	bl	_close
	tbz	x0, #63, LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x20]
	ldr	x9, [x21]
	ldr	w2, [x19]
	cmp	x8, x9
	b.eq	LBB0_2
; %bb.4:
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #2
	b	LBB0_6
LBB0_5:
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #3
LBB0_6:
	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
	b	_vkprintf
LBB0_7:
Lloh8:
	adrp	x8, _fd_close_success_level@GOTPAGE
Lloh9:
	ldr	x8, [x8, _fd_close_success_level@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldr	w2, [x19]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_vkprintf
	mov	w8, #-1
	str	w8, [x19]
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,8,3                      ; @errno
	.comm	_EINTR,8,3                      ; @EINTR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"close (%d) failed. %m\n"

	.comm	_fd_close_success_level,4,2     ; @fd_close_success_level
l_.str.1:                               ; @.str.1
	.asciz	"fd = %d: was successfully closed.\n"

l_.str.2:                               ; @.str.2
	.asciz	"skip closing negative fd = %d\n"

	.no_dead_strip	_fd_close
.subsections_via_symbols
