	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FileClose                      ## -- Begin function FileClose
	.p2align	4, 0x90
_FileClose:                             ## @FileClose
	.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	%rdi, %r12
	callq	_FileIsValid
	movl	%eax, %edi
	callq	_Assert
	movq	_LOG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_VfdCache@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	leaq	(,%r12,8), %rcx
	leaq	(%rcx,%rcx,4), %rbx
	movl	16(%rax,%rbx), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_elog
	movl	%eax, %edi
	callq	_DO_DB
	movq	(%r14), %r14
	addq	%r14, %rbx
	movq	%r12, %rdi
	callq	_FileIsNotOpen
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	leaq	(%r12,%r12,4), %r15
	leaq	(%r14,%r15,8), %r13
	addq	$32, %r13
	movl	32(%r14,%r15,8), %edi
	callq	_close
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	movq	_FD_TEMP_FILE_LIMIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_LOG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	testl	%eax, (%rbx)
	jne	LBB0_4
## %bb.3:
	callq	_data_sync_elevel
	movl	%eax, %edi
LBB0_4:
	movslq	16(%r14,%r15,8), %rdx
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_elog
LBB0_5:
	movq	_nfile@GOTPCREL(%rip), %rax
	decl	(%rax)
	movq	_VFD_CLOSED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r13)
	movq	%r12, %rdi
	callq	_Delete
LBB0_6:
	movl	(%rbx), %eax
	movq	_FD_TEMP_FILE_LIMIT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.7:
	leaq	(%r12,%r12,4), %rax
	movl	24(%r14,%rax,8), %ecx
	movq	_temporary_files_size@GOTPCREL(%rip), %rdx
	subl	%ecx, (%rdx)
	movq	$0, 24(%r14,%rax,8)
	movl	(%rbx), %eax
LBB0_8:
	movq	_FD_DELETE_AT_CLOSE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	je	LBB0_16
## %bb.9:
	notl	%ecx
	andl	%ecx, %eax
	movl	%eax, (%rbx)
	leaq	(%r12,%r12,4), %r13
	movl	16(%r14,%r13,8), %edi
	leaq	-48(%rbp), %rsi
	callq	_stat
	xorl	%ebx, %ebx
	movq	_errno@GOTPCREL(%rip), %rcx
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movl	(%rcx), %ebx
LBB0_11:
	leaq	(%r14,%r13,8), %r15
	addq	$16, %r15
	movl	16(%r14,%r13,8), %edi
	callq	_unlink
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	_LOG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movslq	(%r15), %rdx
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_elog
LBB0_13:
	testl	%ebx, %ebx
	je	LBB0_14
## %bb.15:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	movq	_LOG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movslq	(%r15), %rdx
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_elog
	jmp	LBB0_16
LBB0_14:
	movl	(%r15), %edi
	movl	-48(%rbp), %esi
	callq	_ReportTemporaryFileUsage
LBB0_16:
	leaq	(%r12,%r12,4), %rax
	movq	8(%r14,%rax,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_18
## %bb.17:
	movq	%r12, %rsi
	callq	_ResourceOwnerForgetFile
LBB0_18:
	movq	%r12, %rdi
	callq	_FreeVfd
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LOG,4,2                        ## @LOG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FileClose: %d (%s)"

	.comm	_VfdCache,8,3                   ## @VfdCache
	.comm	_FD_TEMP_FILE_LIMIT,4,2         ## @FD_TEMP_FILE_LIMIT
L_.str.1:                               ## @.str.1
	.asciz	"could not close file \"%s\": %m"

	.comm	_nfile,4,2                      ## @nfile
	.comm	_VFD_CLOSED,4,2                 ## @VFD_CLOSED
	.comm	_temporary_files_size,4,2       ## @temporary_files_size
	.comm	_FD_DELETE_AT_CLOSE,4,2         ## @FD_DELETE_AT_CLOSE
	.comm	_errno,4,2                      ## @errno
L_.str.2:                               ## @.str.2
	.asciz	"could not unlink file \"%s\": %m"

L_.str.3:                               ## @.str.3
	.asciz	"could not stat file \"%s\": %m"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FileClose                      ; -- Begin function FileClose
	.p2align	2
_FileClose:                             ; @FileClose
	.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	x19, x0
	bl	_FileIsValid
	bl	_Assert
Lloh0:
	adrp	x20, _LOG@GOTPAGE
Lloh1:
	ldr	x20, [x20, _LOG@GOTPAGEOFF]
Lloh2:
	adrp	x21, _VfdCache@GOTPAGE
Lloh3:
	ldr	x21, [x21, _VfdCache@GOTPAGEOFF]
	ldr	w0, [x20]
	ldr	x8, [x21]
	add	x9, x19, x19, lsl #2
	lsl	x22, x9, #3
	add	x8, x8, x22
	ldr	w8, [x8, #16]
	str	x8, [sp]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_elog
	bl	_DO_DB
	ldr	x21, [x21]
	add	x22, x21, x22
	mov	x0, x19
	bl	_FileIsNotOpen
Lloh6:
	adrp	x23, _FD_TEMP_FILE_LIMIT@GOTPAGE
Lloh7:
	ldr	x23, [x23, _FD_TEMP_FILE_LIMIT@GOTPAGEOFF]
	cbnz	w0, LBB0_6
; %bb.1:
	mov	w8, #40
	madd	x24, x19, x8, x21
	ldr	w0, [x24, #32]!
	bl	_close
	cbz	x0, LBB0_5
; %bb.2:
	ldr	w8, [x22]
	ldr	w9, [x23]
	ldr	w0, [x20]
	tst	w9, w8
	b.ne	LBB0_4
; %bb.3:
	bl	_data_sync_elevel
LBB0_4:
	mov	w8, #40
	madd	x8, x19, x8, x21
	ldrsw	x2, [x8, #16]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_elog
LBB0_5:
Lloh10:
	adrp	x8, _nfile@GOTPAGE
Lloh11:
	ldr	x8, [x8, _nfile@GOTPAGEOFF]
	ldr	w9, [x8]
	sub	w9, w9, #1
	str	w9, [x8]
Lloh12:
	adrp	x8, _VFD_CLOSED@GOTPAGE
Lloh13:
	ldr	x8, [x8, _VFD_CLOSED@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [x24]
	mov	x0, x19
	bl	_Delete
LBB0_6:
	ldr	w8, [x22]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
	mov	w8, #40
	madd	x8, x19, x8, x21
Lloh15:
	adrp	x9, _temporary_files_size@GOTPAGE
Lloh16:
	ldr	x9, [x9, _temporary_files_size@GOTPAGEOFF]
	ldr	w10, [x8, #24]
	ldr	w11, [x9]
	sub	w10, w11, w10
	str	w10, [x9]
	str	xzr, [x8, #24]
	ldr	w8, [x22]
LBB0_8:
Lloh17:
	adrp	x9, _FD_DELETE_AT_CLOSE@GOTPAGE
Lloh18:
	ldr	x9, [x9, _FD_DELETE_AT_CLOSE@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.9:
	bic	w8, w8, w9
	str	w8, [x22]
	mov	w8, #40
	madd	x22, x19, x8, x21
	ldr	w0, [x22, #16]!
	add	x1, sp, #8
	bl	_stat
Lloh20:
	adrp	x23, _errno@GOTPAGE
Lloh21:
	ldr	x23, [x23, _errno@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	x0, #0
	csel	w24, wzr, w8, eq
	ldr	w0, [x22]
	bl	_unlink
	cbz	x0, LBB0_11
; %bb.10:
	ldr	w0, [x20]
	ldrsw	x2, [x22]
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_elog
LBB0_11:
	cbz	w24, LBB0_13
; %bb.12:
	str	w24, [x23]
	ldr	w0, [x20]
	ldrsw	x2, [x22]
Lloh24:
	adrp	x1, l_.str.3@PAGE
Lloh25:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_elog
	b	LBB0_14
LBB0_13:
	ldr	w0, [x22]
	ldr	w1, [sp, #8]
	bl	_ReportTemporaryFileUsage
LBB0_14:
	mov	w8, #40
	madd	x8, x19, x8, x21
	ldr	x0, [x8, #8]
	cbz	x0, LBB0_16
; %bb.15:
	mov	x1, x19
	bl	_ResourceOwnerForgetFile
LBB0_16:
	mov	x0, x19
	bl	_FreeVfd
	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
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_LOG,4,2                        ; @LOG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FileClose: %d (%s)"

	.comm	_VfdCache,8,3                   ; @VfdCache
	.comm	_FD_TEMP_FILE_LIMIT,4,2         ; @FD_TEMP_FILE_LIMIT
l_.str.1:                               ; @.str.1
	.asciz	"could not close file \"%s\": %m"

	.comm	_nfile,4,2                      ; @nfile
	.comm	_VFD_CLOSED,4,2                 ; @VFD_CLOSED
	.comm	_temporary_files_size,4,2       ; @temporary_files_size
	.comm	_FD_DELETE_AT_CLOSE,4,2         ; @FD_DELETE_AT_CLOSE
	.comm	_errno,4,2                      ; @errno
l_.str.2:                               ; @.str.2
	.asciz	"could not unlink file \"%s\": %m"

l_.str.3:                               ; @.str.3
	.asciz	"could not stat file \"%s\": %m"

.subsections_via_symbols
