	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dos_open
_dos_open:                              ## @dos_open
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	movl	$8, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %r15
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_dos_mount
	testl	%eax, %eax
	je	LBB0_4
## %bb.2:
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_free
	jmp	LBB0_16
LBB0_3:
	movq	_errno@GOTPCREL(%rip), %rax
LBB0_15:
	movl	(%rax), %ebx
	jmp	LBB0_16
LBB0_4:
	leaq	-40(%rbp), %rdx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_namede
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movl	%eax, %ebx
LBB0_6:
	movq	%r15, %rdi
	callq	_dos_unmount
LBB0_16:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	4(%r15), %edi
	movq	-40(%rbp), %rsi
	callq	_stclus
	movq	%rax, %rbx
	movq	-40(%rbp), %rax
	movl	4(%rax), %edi
	callq	_cv4
	movq	-40(%rbp), %rcx
	movq	_FA_DIR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, (%rcx)
	je	LBB0_9
## %bb.8:
	testq	%rax, %rax
	jne	LBB0_14
	jmp	LBB0_10
LBB0_9:
	testq	%rbx, %rbx
	setne	%cl
	testq	%rax, %rax
	sete	%al
	xorb	%cl, %al
	je	LBB0_14
LBB0_10:
	testq	%rbx, %rbx
	je	LBB0_12
## %bb.11:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_okclus
	testl	%eax, %eax
	je	LBB0_14
LBB0_12:
	movl	$16, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_17
## %bb.13:
	movq	%rax, %rbx
	movq	%rax, %rdi
	movl	$16, %esi
	callq	_bzero
	movq	%r15, 8(%rbx)
	incl	(%r15)
	movq	-40(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	movq	%rbx, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_14:
	movq	%r15, %rdi
	callq	_dos_unmount
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_17:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,4,2                      ## @errno
	.comm	_FA_DIR,4,2                     ## @FA_DIR
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_dos_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dos_open
_dos_open:                              ; @dos_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x22, x0
	mov	w0, #8
	bl	_malloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	mov	x1, x20
	bl	_dos_mount
	cbz	w0, LBB0_5
; %bb.2:
	mov	x21, x0
	mov	x0, x19
	bl	_free
	b	LBB0_8
LBB0_3:
Lloh0:
	adrp	x8, _errno@GOTPAGE
Lloh1:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
LBB0_4:
	ldr	w21, [x8]
	b	LBB0_8
LBB0_5:
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x22
	bl	_namede
	cbz	w0, LBB0_9
; %bb.6:
	mov	x21, x0
LBB0_7:
	mov	x0, x19
	bl	_dos_unmount
LBB0_8:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_9:
	ldr	w0, [x19, #4]
	ldr	x1, [sp, #8]
	bl	_stclus
	mov	x21, x0
	ldr	x8, [sp, #8]
	ldr	w0, [x8, #4]
	bl	_cv4
	ldr	x8, [sp, #8]
	ldr	w8, [x8]
Lloh2:
	adrp	x9, _FA_DIR@GOTPAGE
Lloh3:
	ldr	x9, [x9, _FA_DIR@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.10:
	cbnz	x0, LBB0_16
	b	LBB0_12
LBB0_11:
	cmp	x21, #0
	cset	w8, ne
	cmp	x0, #0
	cset	w9, eq
	eor	w8, w8, w9
	tbz	w8, #0, LBB0_16
LBB0_12:
	cbz	x21, LBB0_14
; %bb.13:
	mov	x0, x19
	mov	x1, x21
	bl	_okclus
	cbz	w0, LBB0_16
LBB0_14:
	mov	w0, #16
	bl	_malloc
	cbz	x0, LBB0_17
; %bb.15:
	mov	x22, x0
	mov	w1, #16
	bl	_bzero
	mov	w21, #0
	str	x19, [x22, #8]
	ldr	w8, [x19]
	add	w8, w8, #1
	str	w8, [x19]
	ldr	x8, [sp, #8]
	ldr	x8, [x8]
	str	x8, [x22]
	str	x22, [x20]
	b	LBB0_8
LBB0_16:
	mov	x0, x19
	bl	_dos_unmount
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_17:
Lloh7:
	adrp	x8, _errno@GOTPAGE
Lloh8:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh9:
	ldr	w21, [x8]
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,4,2                      ; @errno
	.comm	_FA_DIR,4,2                     ; @FA_DIR
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_dos_open
.subsections_via_symbols
