	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__FAT_rename_r                  ## -- Begin function _FAT_rename_r
	.p2align	4, 0x90
__FAT_rename_r:                         ## @_FAT_rename_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	__FAT_partition_getPartitionFromPath
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	__FAT_lock
	movq	%r15, %rdi
	callq	__FAT_partition_getPartitionFromPath
	cmpq	%rax, %r12
	je	LBB0_4
## %bb.3:
	movq	%r12, %rdi
	callq	__FAT_unlock
	movq	_EXDEV@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_4:
	cmpq	$0, 16(%r12)
	je	LBB0_6
## %bb.5:
	movq	%r12, %rdi
	callq	__FAT_unlock
	movq	_EROFS@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_6:
	movq	%rbx, %rdi
	movl	$58, %esi
	callq	_strchr
	leaq	1(%rax), %r13
	testq	%rax, %rax
	cmoveq	%rbx, %r13
	movq	%r13, %rdi
	movl	$58, %esi
	callq	_strchr
	testq	%rax, %rax
	jne	LBB0_7
## %bb.8:
	movq	%r15, %rdi
	movl	$58, %esi
	callq	_strchr
	leaq	1(%rax), %rbx
	testq	%rax, %rax
	cmoveq	%r15, %rbx
	movq	%rbx, %rdi
	movl	$58, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_9
LBB0_7:
	movq	%r12, %rdi
	callq	__FAT_unlock
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_25:
	movq	(%rax), %rax
	movq	%rax, (%r14)
	movl	$-1, %eax
LBB0_26:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	leaq	-56(%rbp), %rsi
	movq	%r12, %rdi
	movq	%r13, %rdx
	xorl	%ecx, %ecx
	callq	__FAT_directory_entryFromPath
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	leaq	-48(%rbp), %rsi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	xorl	%ecx, %ecx
	callq	__FAT_directory_entryFromPath
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	%r12, %rdi
	callq	__FAT_unlock
	movq	_EEXIST@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_10:
	movq	%r12, %rdi
	callq	__FAT_unlock
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_13:
	movq	_DIR_SEPARATOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_strrchr
	testq	%rax, %rax
	je	LBB0_14
## %bb.15:
	movq	%rax, %r15
	leaq	-48(%rbp), %rsi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	movq	%rax, %rcx
	callq	__FAT_directory_entryFromPath
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	leaq	-48(%rbp), %rdi
	callq	__FAT_directory_isDirectory
	testl	%eax, %eax
	je	LBB0_17
## %bb.18:
	movl	-44(%rbp), %esi
	movq	%r12, %rdi
	callq	__FAT_directory_entryGetCluster
	movl	%eax, %r13d
	incq	%r15
	movq	%r15, %rbx
	jmp	LBB0_19
LBB0_14:
	movl	8(%r12), %r13d
LBB0_19:
	leaq	-48(%rbp), %r15
	leaq	-56(%rbp), %rsi
	movq	%r15, %rdi
	movl	$8, %edx
	callq	_memcpy
	movl	-48(%rbp), %edi
	movq	_NAME_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	decq	%rdx
	movq	%rbx, %rsi
	callq	_strncpy
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%r13d, %edx
	callq	__FAT_directory_addEntry
	testl	%eax, %eax
	je	LBB0_20
## %bb.21:
	leaq	-56(%rbp), %rsi
	movq	%r12, %rdi
	callq	__FAT_directory_removeEntry
	testl	%eax, %eax
	je	LBB0_22
## %bb.23:
	movl	4(%r12), %edi
	callq	__FAT_cache_flush
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	__FAT_unlock
	xorl	%eax, %eax
	testl	%ebx, %ebx
	jne	LBB0_26
	jmp	LBB0_24
LBB0_17:
	movq	%r12, %rdi
	callq	__FAT_unlock
	movq	_ENOTDIR@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_20:
	movq	%r12, %rdi
	callq	__FAT_unlock
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_22:
	movq	%r12, %rdi
	callq	__FAT_unlock
LBB0_24:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,8,3                     ## @ENODEV
	.comm	_EXDEV,8,3                      ## @EXDEV
	.comm	_EROFS,8,3                      ## @EROFS
	.comm	_EINVAL,8,3                     ## @EINVAL
	.comm	_ENOENT,8,3                     ## @ENOENT
	.comm	_EEXIST,8,3                     ## @EEXIST
	.comm	_DIR_SEPARATOR,4,2              ## @DIR_SEPARATOR
	.comm	_ENOTDIR,8,3                    ## @ENOTDIR
	.comm	_NAME_MAX,8,3                   ## @NAME_MAX
	.comm	_ENOSPC,8,3                     ## @ENOSPC
	.comm	_EIO,8,3                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__FAT_rename_r                  ; -- Begin function _FAT_rename_r
	.p2align	2
__FAT_rename_r:                         ; @_FAT_rename_r
	.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	x21, x2
	mov	x22, x1
	mov	x19, x0
	mov	x0, x1
	bl	__FAT_partition_getPartitionFromPath
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	bl	__FAT_lock
	mov	x0, x21
	bl	__FAT_partition_getPartitionFromPath
	cmp	x20, x0
	b.eq	LBB0_4
; %bb.2:
	mov	x0, x20
	bl	__FAT_unlock
Lloh0:
	adrp	x8, _EXDEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EXDEV@GOTPAGEOFF]
	b	LBB0_9
LBB0_3:
Lloh2:
	adrp	x8, _ENODEV@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_9
LBB0_4:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_6
; %bb.5:
	mov	x0, x20
	bl	__FAT_unlock
Lloh4:
	adrp	x8, _EROFS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EROFS@GOTPAGEOFF]
	b	LBB0_9
LBB0_6:
	mov	x0, x22
	mov	w1, #58
	bl	_strchr
	cmp	x0, #0
	csinc	x22, x22, x0, eq
	mov	x0, x22
	mov	w1, #58
	bl	_strchr
	cbnz	x0, LBB0_8
; %bb.7:
	mov	x0, x21
	mov	w1, #58
	bl	_strchr
	cmp	x0, #0
	csinc	x21, x21, x0, eq
	mov	x0, x21
	mov	w1, #58
	bl	_strchr
	cbz	x0, LBB0_11
LBB0_8:
	mov	x0, x20
	bl	__FAT_unlock
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_9:
	ldr	x8, [x8]
	str	x8, [x19]
	mov	w0, #-1
LBB0_10:
	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
LBB0_11:
	add	x1, sp, #8
	mov	x0, x20
	mov	x2, x22
	mov	x3, #0
	bl	__FAT_directory_entryFromPath
	cbz	x0, LBB0_14
; %bb.12:
	mov	x1, sp
	mov	x0, x20
	mov	x2, x21
	mov	x3, #0
	bl	__FAT_directory_entryFromPath
	cbz	x0, LBB0_15
; %bb.13:
	mov	x0, x20
	bl	__FAT_unlock
Lloh8:
	adrp	x8, _EEXIST@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
	b	LBB0_9
LBB0_14:
	mov	x0, x20
	bl	__FAT_unlock
Lloh10:
	adrp	x8, _ENOENT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_9
LBB0_15:
Lloh12:
	adrp	x8, _DIR_SEPARATOR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DIR_SEPARATOR@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_strrchr
	cbz	x0, LBB0_19
; %bb.16:
	mov	x23, x0
	mov	x1, sp
	mov	x0, x20
	mov	x2, x21
	mov	x3, x23
	bl	__FAT_directory_entryFromPath
	cbz	x0, LBB0_24
; %bb.17:
	mov	x0, sp
	bl	__FAT_directory_isDirectory
	cbz	w0, LBB0_24
; %bb.18:
	ldr	w1, [sp, #4]
	mov	x0, x20
	bl	__FAT_directory_entryGetCluster
	mov	x22, x0
	add	x21, x23, #1
	b	LBB0_20
LBB0_19:
	ldr	w22, [x20, #8]
LBB0_20:
	mov	x0, sp
	add	x1, sp, #8
	mov	w2, #8
	bl	_memcpy
	ldr	w0, [sp]
Lloh15:
	adrp	x8, _NAME_MAX@GOTPAGE
Lloh16:
	ldr	x8, [x8, _NAME_MAX@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	sub	x2, x8, #1
	mov	x1, x21
	bl	_strncpy
	mov	x1, sp
	mov	x0, x20
	mov	x2, x22
	bl	__FAT_directory_addEntry
	cbz	w0, LBB0_25
; %bb.21:
	add	x1, sp, #8
	mov	x0, x20
	bl	__FAT_directory_removeEntry
	cbz	w0, LBB0_26
; %bb.22:
	ldr	w0, [x20, #4]
	bl	__FAT_cache_flush
	mov	x21, x0
	mov	x0, x20
	bl	__FAT_unlock
	cbz	w21, LBB0_27
; %bb.23:
	mov	w0, #0
	b	LBB0_10
LBB0_24:
	mov	x0, x20
	bl	__FAT_unlock
Lloh18:
	adrp	x8, _ENOTDIR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOTDIR@GOTPAGEOFF]
	b	LBB0_9
LBB0_25:
	mov	x0, x20
	bl	__FAT_unlock
Lloh20:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
	b	LBB0_9
LBB0_26:
	mov	x0, x20
	bl	__FAT_unlock
LBB0_27:
Lloh22:
	adrp	x8, _EIO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,8,3                     ; @ENODEV
	.comm	_EXDEV,8,3                      ; @EXDEV
	.comm	_EROFS,8,3                      ; @EROFS
	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_ENOENT,8,3                     ; @ENOENT
	.comm	_EEXIST,8,3                     ; @EEXIST
	.comm	_DIR_SEPARATOR,4,2              ; @DIR_SEPARATOR
	.comm	_ENOTDIR,8,3                    ; @ENOTDIR
	.comm	_NAME_MAX,8,3                   ; @NAME_MAX
	.comm	_ENOSPC,8,3                     ; @ENOSPC
	.comm	_EIO,8,3                        ; @EIO
.subsections_via_symbols
