	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__FAT_close_r                   ## -- Begin function _FAT_close_r
	.p2align	4, 0x90
__FAT_close_r:                          ## @_FAT_close_r
	.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
	movq	%rdi, %r15
	cmpl	$0, (%rsi)
	je	LBB0_1
## %bb.2:
	movq	%rsi, %rbx
	movq	8(%rsi), %rdi
	addq	$4, %rdi
	callq	__FAT_lock
	xorl	%r14d, %r14d
	cmpq	$0, 32(%rbx)
	je	LBB0_5
## %bb.3:
	movq	%rbx, %rdi
	callq	__FAT_syncToDisc
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, (%r15)
	movl	$-1, %r14d
LBB0_5:
	movl	$0, (%rbx)
	movq	8(%rbx), %rdi
	decl	(%rdi)
	movq	16(%rbx), %rax
	movq	24(%rbx), %rcx
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%rcx, (%rax)
LBB0_7:
	leaq	8(%rdi), %rdx
	testq	%rcx, %rcx
	cmovneq	%rcx, %rdx
	movq	%rax, (%rdx)
	addq	$4, %rdi
	callq	__FAT_unlock
	jmp	LBB0_8
LBB0_1:
	movq	_EBADF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movl	$-1, %r14d
LBB0_8:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBADF,4,2                      ## @EBADF
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__FAT_close_r                   ; -- Begin function _FAT_close_r
	.p2align	2
__FAT_close_r:                          ; @_FAT_close_r
	.cfi_startproc
; %bb.0:
	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	x20, x0
	ldr	w8, [x1]
	cbz	w8, LBB0_4
; %bb.1:
	mov	x19, x1
	ldr	x8, [x1, #8]
	add	x0, x8, #4
	bl	__FAT_lock
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_5
; %bb.2:
	mov	x0, x19
	bl	__FAT_syncToDisc
	cbz	w0, LBB0_5
; %bb.3:
	str	w0, [x20]
	mov	w20, #-1
	b	LBB0_6
LBB0_4:
Lloh0:
	adrp	x8, _EBADF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBADF@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x20]
	mov	w20, #-1
	b	LBB0_9
LBB0_5:
	mov	w20, #0
LBB0_6:
	str	wzr, [x19]
	ldp	x8, x9, [x19, #8]
	ldr	w10, [x8]
	sub	w10, w10, #1
	str	w10, [x8]
	ldr	x10, [x19, #24]
	cbz	x9, LBB0_8
; %bb.7:
	str	x10, [x9]
LBB0_8:
	add	x11, x8, #8
	cmp	x10, #0
	csel	x10, x11, x10, eq
	str	x9, [x10]
	add	x0, x8, #4
	bl	__FAT_unlock
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EBADF,4,2                      ; @EBADF
.subsections_via_symbols
