	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fs_dev_open_r
_fs_dev_open_r:                         ## @fs_dev_open_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
	movl	%ecx, %ebx
	movq	%rdx, %r13
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	%rdx, %rdi
	callq	_fs_dev_get_device_data
	movq	%rax, %r12
	movl	$-1, %eax
	testq	%r14, %r14
	je	LBB0_22
## %bb.1:
	testq	%r12, %r12
	je	LBB0_2
## %bb.4:
	testq	%r15, %r15
	je	LBB0_5
## %bb.6:
	movq	%r12, 32(%r15)
	movl	%ebx, (%r15)
	movl	%ebx, %ecx
	andl	$3, %ecx
	movq	_O_RDONLY@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_10
## %bb.7:
	movq	$1, 4(%r15)
	movl	$0, 12(%r15)
	leaq	L_.str(%rip), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_8
LBB0_2:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_3:
	movl	(%rcx), %ecx
	movl	%ecx, (%r14)
	jmp	LBB0_22
LBB0_10:
	movq	_O_WRONLY@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_13
## %bb.11:
	movabsq	$4294967296, %rax               ## imm = 0x100000000
	movq	%rax, 4(%r15)
	movq	_O_APPEND@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movl	%ebx, 12(%r15)
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rcx
	jmp	LBB0_12
LBB0_13:
	movq	_O_RDWR@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_15
## %bb.14:
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, 4(%r15)
	movq	_O_APPEND@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movl	%ebx, 12(%r15)
	leaq	L_.str.4(%rip), %rax
	leaq	L_.str.3(%rip), %rcx
LBB0_12:
	cmoveq	%rax, %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
LBB0_8:
	movl	$-1, -44(%rbp)
	movl	(%r12), %edi
	callq	_OSLockMutex
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_fs_dev_real_path
	testq	%r13, %r13
	je	LBB0_9
## %bb.16:
	movq	%rax, %rbx
	movl	4(%r12), %edi
	leaq	-44(%rbp), %rcx
	movq	%rax, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_IOSUHAX_FSA_OpenFile
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_free
	testl	%r13d, %r13d
	je	LBB0_17
## %bb.20:
	movl	%r13d, (%r14)
	jmp	LBB0_21
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	jmp	LBB0_21
LBB0_17:
	movl	4(%r12), %edi
	movl	-44(%rbp), %esi
	leaq	-64(%rbp), %rdx
	callq	_IOSUHAX_FSA_StatFile
	testl	%eax, %eax
	je	LBB0_19
## %bb.18:
	movl	%eax, %ebx
	movl	4(%r12), %edi
	movl	-44(%rbp), %esi
	callq	_IOSUHAX_FSA_CloseFile
	movl	%ebx, (%r14)
LBB0_21:
	movl	(%r12), %edi
	callq	_OSUnlockMutex
	movl	$-1, %eax
LBB0_22:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	_EACCES@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_19:
	movl	-44(%rbp), %eax
	movl	%eax, 16(%r15)
	movq	$0, 24(%r15)
	movl	-64(%rbp), %eax
	movl	%eax, 20(%r15)
	movl	(%r12), %edi
	callq	_OSUnlockMutex
	movl	%r15d, %eax
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"r"

	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_O_APPEND,4,2                   ## @O_APPEND
L_.str.1:                               ## @.str.1
	.asciz	"a"

L_.str.2:                               ## @.str.2
	.asciz	"w"

	.comm	_O_RDWR,4,2                     ## @O_RDWR
L_.str.3:                               ## @.str.3
	.asciz	"a+"

L_.str.4:                               ## @.str.4
	.asciz	"r+"

	.comm	_EACCES,4,2                     ## @EACCES
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_fs_dev_open_r
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function fs_dev_open_r
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
lCPI0_1:
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_fs_dev_open_r:                         ; @fs_dev_open_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	x23, x3
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	mov	x0, x2
	bl	_fs_dev_get_device_data
	cbz	x20, LBB0_20
; %bb.1:
	mov	x21, x0
	cbz	x0, LBB0_5
; %bb.2:
	cbz	x19, LBB0_6
; %bb.3:
	str	x21, [x19, #32]
	str	w23, [x19]
	and	w8, w23, #0x3
Lloh0:
	adrp	x9, _O_RDONLY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _O_RDONLY@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.4:
Lloh3:
	adrp	x8, lCPI0_1@PAGE
Lloh4:
	ldr	d0, [x8, lCPI0_1@PAGEOFF]
	stur	d0, [x19, #4]
	str	wzr, [x19, #12]
Lloh5:
	adrp	x23, l_.str@PAGE
Lloh6:
	add	x23, x23, l_.str@PAGEOFF
	b	LBB0_13
LBB0_5:
Lloh7:
	adrp	x8, _ENODEV@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	str	w8, [x20]
	b	LBB0_20
LBB0_8:
Lloh11:
	adrp	x9, _O_WRONLY@GOTPAGE
Lloh12:
	ldr	x9, [x9, _O_WRONLY@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_10
; %bb.9:
Lloh14:
	adrp	x8, lCPI0_0@PAGE
Lloh15:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	stur	d0, [x19, #4]
Lloh16:
	adrp	x8, _O_APPEND@GOTPAGE
Lloh17:
	ldr	x8, [x8, _O_APPEND@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	ands	w8, w8, w23
	str	w8, [x19, #12]
Lloh19:
	adrp	x8, l_.str.1@PAGE
Lloh20:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh21:
	adrp	x9, l_.str.2@PAGE
Lloh22:
	add	x9, x9, l_.str.2@PAGEOFF
	b	LBB0_12
LBB0_10:
Lloh23:
	adrp	x9, _O_RDWR@GOTPAGE
Lloh24:
	ldr	x9, [x9, _O_RDWR@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_22
; %bb.11:
	movi.2s	v0, #1
	stur	d0, [x19, #4]
Lloh26:
	adrp	x8, _O_APPEND@GOTPAGE
Lloh27:
	ldr	x8, [x8, _O_APPEND@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	ands	w8, w8, w23
	str	w8, [x19, #12]
Lloh29:
	adrp	x8, l_.str.3@PAGE
Lloh30:
	add	x8, x8, l_.str.3@PAGEOFF
Lloh31:
	adrp	x9, l_.str.4@PAGE
Lloh32:
	add	x9, x9, l_.str.4@PAGEOFF
LBB0_12:
	csel	x23, x9, x8, eq
LBB0_13:
	mov	w8, #-1
	str	w8, [sp, #12]
	ldr	w0, [x21]
	bl	_OSLockMutex
	mov	x0, x22
	mov	x1, x21
	bl	_fs_dev_real_path
	cbz	x22, LBB0_18
; %bb.14:
	mov	x24, x0
	ldr	w0, [x21, #4]
	add	x3, sp, #12
	mov	x1, x24
	mov	x2, x23
	bl	_IOSUHAX_FSA_OpenFile
	mov	x22, x0
	mov	x0, x24
	bl	_free
	cbnz	w22, LBB0_17
; %bb.15:
	ldr	w0, [x21, #4]
	ldr	w1, [sp, #12]
	add	x2, sp, #8
	bl	_IOSUHAX_FSA_StatFile
	cbz	w0, LBB0_23
; %bb.16:
	mov	x22, x0
	ldr	w0, [x21, #4]
	ldr	w1, [sp, #12]
	bl	_IOSUHAX_FSA_CloseFile
LBB0_17:
	str	w22, [x20]
	b	LBB0_19
LBB0_18:
Lloh33:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	str	w8, [x20]
LBB0_19:
	ldr	w0, [x21]
	bl	_OSUnlockMutex
LBB0_20:
	mov	w19, #-1
LBB0_21:
	mov	x0, x19
	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_22:
Lloh36:
	adrp	x8, _EACCES@GOTPAGE
Lloh37:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
	b	LBB0_7
LBB0_23:
	ldp	w9, w8, [sp, #8]
	str	xzr, [x19, #24]
	stp	w8, w9, [x19, #16]
	ldr	w0, [x21]
	bl	_OSUnlockMutex
	b	LBB0_21
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdr	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdrp	Lloh14, Lloh16
	.loh AdrpLdr	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"r"

	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_O_APPEND,4,2                   ; @O_APPEND
l_.str.1:                               ; @.str.1
	.asciz	"a"

l_.str.2:                               ; @.str.2
	.asciz	"w"

	.comm	_O_RDWR,4,2                     ; @O_RDWR
l_.str.3:                               ; @.str.3
	.asciz	"a+"

l_.str.4:                               ; @.str.4
	.asciz	"r+"

	.comm	_EACCES,4,2                     ; @EACCES
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_fs_dev_open_r
.subsections_via_symbols
