	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function io_close_dest
_io_close_dest:                         ## @io_close_dest
	.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
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	_restore_stdout_flags@GOTPCREL(%rip), %rbx
	cmpl	$0, (%rbx)
	je	LBB0_3
## %bb.1:
	movl	(%r15), %eax
	movq	_STDOUT_FILENO@GOTPCREL(%rip), %r12
	xorl	%edi, %edi
	cmpl	(%r12), %eax
	sete	%dil
	callq	_assert
	movl	$0, (%rbx)
	movl	(%r12), %edi
	movq	_F_SETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_stdout_flags@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_fcntl
	cmpl	$-1, %eax
	je	LBB0_2
LBB0_3:
	movl	(%r15), %edi
	xorl	%ebx, %ebx
	cmpl	$-1, %edi
	je	LBB0_10
## %bb.4:
	movq	_STDOUT_FILENO@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edi
	je	LBB0_10
## %bb.5:
	callq	_close
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	callq	__
	movl	%eax, %ebx
	movl	4(%r15), %r14d
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	movl	%ebx, %edi
	movl	%r14d, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_message_error
	movl	4(%r15), %edi
	leaq	8(%r15), %rsi
	callq	_io_unlink
	movl	4(%r15), %edi
	callq	_free
	movl	$1, %ebx
	jmp	LBB0_10
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	__
	movl	%eax, %ebx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	movl	%ebx, %edi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_message_error
	movl	$1, %ebx
	jmp	LBB0_10
LBB0_7:
	testl	%r14d, %r14d
	jne	LBB0_9
## %bb.8:
	movl	4(%r15), %edi
	leaq	8(%r15), %rsi
	callq	_io_unlink
LBB0_9:
	movl	4(%r15), %edi
	callq	_free
LBB0_10:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_restore_stdout_flags,4,2       ## @restore_stdout_flags
	.comm	_STDOUT_FILENO,4,2              ## @STDOUT_FILENO
	.comm	_F_SETFL,4,2                    ## @F_SETFL
	.comm	_stdout_flags,4,2               ## @stdout_flags
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error restoring the O_APPEND flag to standard output: %s"

	.comm	_errno,4,2                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"%s: Closing the file failed: %s"

	.no_dead_strip	_io_close_dest
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function io_close_dest
_io_close_dest:                         ; @io_close_dest
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _restore_stdout_flags@GOTPAGE
Lloh1:
	ldr	x22, [x22, _restore_stdout_flags@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh2:
	adrp	x21, _STDOUT_FILENO@GOTPAGE
Lloh3:
	ldr	x21, [x21, _STDOUT_FILENO@GOTPAGEOFF]
	cbz	w8, LBB0_2
; %bb.1:
	ldr	w8, [x19]
	ldr	w9, [x21]
	cmp	w8, w9
	cset	w0, eq
	bl	_assert
	str	wzr, [x22]
	ldr	w0, [x21]
Lloh4:
	adrp	x8, _F_SETFL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _F_SETFL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
Lloh7:
	adrp	x8, _stdout_flags@GOTPAGE
Lloh8:
	ldr	x8, [x8, _stdout_flags@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	bl	_fcntl
	cmn	w0, #1
	b.eq	LBB0_5
LBB0_2:
	ldr	w0, [x19]
	ldr	w8, [x21]
	cmn	w0, #1
	ccmp	w0, w8, #4, ne
	b.eq	LBB0_9
; %bb.3:
	bl	_close
	cbz	x0, LBB0_6
; %bb.4:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	__
	mov	x20, x0
	ldr	w21, [x19, #4]
Lloh12:
	adrp	x8, _errno@GOTPAGE
Lloh13:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
	mov	x0, x20
	mov	x1, x21
	bl	_message_error
	ldr	w0, [x19, #4]
	add	x1, x19, #8
	bl	_io_unlink
	ldr	w0, [x19, #4]
	bl	_free
	mov	w0, #1
	b	LBB0_10
LBB0_5:
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	bl	__
	mov	x19, x0
Lloh17:
	adrp	x8, _errno@GOTPAGE
Lloh18:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_strerror
	mov	x1, x0
	mov	x0, x19
	bl	_message_error
	mov	w0, #1
	b	LBB0_10
LBB0_6:
	cbnz	w20, LBB0_8
; %bb.7:
	ldr	w0, [x19, #4]
	add	x1, x19, #8
	bl	_io_unlink
LBB0_8:
	ldr	w0, [x19, #4]
	bl	_free
LBB0_9:
	mov	w0, #0
LBB0_10:
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_restore_stdout_flags,4,2       ; @restore_stdout_flags
	.comm	_STDOUT_FILENO,4,2              ; @STDOUT_FILENO
	.comm	_F_SETFL,4,2                    ; @F_SETFL
	.comm	_stdout_flags,4,2               ; @stdout_flags
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error restoring the O_APPEND flag to standard output: %s"

	.comm	_errno,4,2                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"%s: Closing the file failed: %s"

	.no_dead_strip	_io_close_dest
.subsections_via_symbols
