	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_retro_vfs_file_close_impl      ## -- Begin function retro_vfs_file_close_impl
	.p2align	4, 0x90
_retro_vfs_file_close_impl:             ## @retro_vfs_file_close_impl
	.cfi_startproc
## %bb.0:
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_RFILE_HINT_UNBUFFERED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rdi)
	jne	LBB0_5
## %bb.3:
	movq	48(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:
	callq	_fclose
LBB0_5:
	movl	12(%rbx), %edi
	testl	%edi, %edi
	jle	LBB0_7
## %bb.6:
	callq	_close
LBB0_7:
	movq	24(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.8:
	callq	_free
LBB0_9:
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.10:
	callq	_free
LBB0_11:
	movq	%rbx, %rdi
	callq	_free
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_1:
	movl	$-1, %eax
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RFILE_HINT_UNBUFFERED,4,2      ## @RFILE_HINT_UNBUFFERED
	.comm	_RETRO_VFS_FILE_ACCESS_HINT_FREQUENT_ACCESS,4,2 ## @RETRO_VFS_FILE_ACCESS_HINT_FREQUENT_ACCESS
	.comm	_VFS_SCHEME_CDROM,8,3           ## @VFS_SCHEME_CDROM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_retro_vfs_file_close_impl      ; -- Begin function retro_vfs_file_close_impl
	.p2align	2
_retro_vfs_file_close_impl:             ; @retro_vfs_file_close_impl
	.cfi_startproc
; %bb.0:
	cbz	x0, LBB0_11
; %bb.1:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w8, [x0, #8]
Lloh0:
	adrp	x9, _RFILE_HINT_UNBUFFERED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RFILE_HINT_UNBUFFERED@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_4
; %bb.2:
	ldr	x0, [x19, #48]
	cbz	x0, LBB0_4
; %bb.3:
	bl	_fclose
LBB0_4:
	ldr	w0, [x19, #12]
	cmp	w0, #1
	b.lt	LBB0_6
; %bb.5:
	bl	_close
LBB0_6:
	ldr	x0, [x19, #24]
	cbz	x0, LBB0_8
; %bb.7:
	bl	_free
LBB0_8:
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_10
; %bb.9:
	bl	_free
LBB0_10:
	mov	x0, x19
	bl	_free
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_11:
	.cfi_def_cfa wsp, 0
	.cfi_same_value w30
	.cfi_same_value w29
	.cfi_same_value w19
	.cfi_same_value w20
	mov	w0, #-1
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_RFILE_HINT_UNBUFFERED,4,2      ; @RFILE_HINT_UNBUFFERED
	.comm	_RETRO_VFS_FILE_ACCESS_HINT_FREQUENT_ACCESS,4,2 ; @RETRO_VFS_FILE_ACCESS_HINT_FREQUENT_ACCESS
	.comm	_VFS_SCHEME_CDROM,8,3           ; @VFS_SCHEME_CDROM
.subsections_via_symbols
