	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_open                           ## -- Begin function open
	.p2align	4, 0x90
_open:                                  ## @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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	xorl	%eax, %eax
	callq	_o_gethandle
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.1:
	movl	%eax, %r12d
	movq	_files@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movslq	%r12d, %rax
	leaq	(%rax,%rax,2), %r14
	shlq	$4, %r14
	leaq	(%rcx,%r14), %r13
	incl	%ebx
	movl	%ebx, (%rcx,%r14)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%rcx,%r14)
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movups	%xmm0, 32(%rcx,%r14)
	movq	$0, -56(%rbp)
	movq	_exclusive_file_system@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_5
## %bb.2:
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	*(%rbx)
	testl	%eax, %eax
	jne	LBB0_6
LBB0_3:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	addq	%r14, %rax
	addq	$8, %rax
	movq	%rbx, (%rax)
	movq	%r13, %rdi
	callq	_o_rainit
	jmp	LBB0_8
LBB0_4:
	movq	_EMFILE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_7
LBB0_5:
	leaq	-56(%rbp), %rdx
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_devopen
	testl	%eax, %eax
	je	LBB0_9
LBB0_6:
	movl	$0, (%r13)
LBB0_7:
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	$-1, %r12d
LBB0_8:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rdx,%r14), %r8
	addq	$16, %r8
	movl	(%r13), %eax
	movq	_F_NODEV@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	testl	%eax, %esi
	jne	LBB0_11
## %bb.10:
	cmpq	$0, (%r8)
	je	LBB0_19
LBB0_11:
	movq	-56(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_18
## %bb.12:
	cmpb	$0, (%rdi)
	je	LBB0_18
## %bb.13:
	movq	_ENOENT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ecx
	movq	_file_system@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	(%rdx), %rbx
	testq	%rbx, %rbx
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_21
## %bb.14:
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movq	%r13, %rsi
	movl	%ecx, %r15d
	callq	*(%rbx)
	testl	%eax, %eax
	je	LBB0_3
## %bb.15:
	movl	%r15d, %ecx
	movl	$8, %r15d
	movq	-48(%rbp), %r13                 ## 8-byte Reload
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	_EINVAL@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	cmovnel	%eax, %ecx
	movq	_file_system@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r15), %rbx
	testq	%rbx, %rbx
	je	LBB0_20
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	-56(%rbp), %rdi
	movq	%r13, %rsi
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	callq	*(%rbx)
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	addq	$8, %r15
	testl	%eax, %eax
	jne	LBB0_16
	jmp	LBB0_3
LBB0_18:
	movq	_F_RAW@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%r13)
	movq	$0, 24(%rdx,%r14)
	jmp	LBB0_8
LBB0_20:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movl	(%r13), %eax
	movq	_F_NODEV@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	movq	-80(%rbp), %r8                  ## 8-byte Reload
LBB0_21:
	testl	%eax, %esi
	jne	LBB0_24
## %bb.22:
	movq	(%r8), %rax
	testq	%rax, %rax
	je	LBB0_24
## %bb.23:
	movq	%r13, %rdi
	movl	%ecx, %ebx
	callq	*(%rax)
	movl	%ebx, %ecx
	movq	-48(%rbp), %r13                 ## 8-byte Reload
LBB0_24:
	testl	%ecx, %ecx
	je	LBB0_19
## %bb.25:
	movq	%r13, %rdi
	movl	%ecx, %ebx
	callq	_devclose
	movl	%ebx, %eax
	jmp	LBB0_6
LBB0_19:
	xorl	%eax, %eax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_EMFILE,4,2                     ## @EMFILE
	.comm	_errno,4,2                      ## @errno
	.comm	_files,8,3                      ## @files
	.comm	_exclusive_file_system,8,3      ## @exclusive_file_system
	.comm	_F_NODEV,4,2                    ## @F_NODEV
	.comm	_F_RAW,4,2                      ## @F_RAW
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_file_system,8,3                ## @file_system
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_open                           ; -- Begin function open
	.p2align	2
_open:                                  ; @open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x1
	mov	x21, x0
	bl	_o_gethandle
	cmn	w0, #1
	b.eq	LBB0_4
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x8, _files@GOTPAGE
Lloh1:
	ldr	x8, [x8, _files@GOTPAGEOFF]
Lloh2:
	ldr	x25, [x8]
	mov	w8, #48
	smaddl	x19, w0, w8, x25
	add	w8, w22, #1
	str	w8, [x19]
	mov	x22, x19
	str	xzr, [x22, #16]!
	mov	x23, x19
	str	xzr, [x23, #8]!
	stp	xzr, xzr, [x19, #32]
	str	xzr, [sp, #8]
Lloh3:
	adrp	x8, _exclusive_file_system@GOTPAGE
Lloh4:
	ldr	x8, [x8, _exclusive_file_system@GOTPAGEOFF]
Lloh5:
	ldr	x26, [x8]
	cbz	x26, LBB0_5
; %bb.2:
	ldr	x8, [x26]
	mov	x0, x21
	mov	x1, x19
	blr	x8
	mov	x21, x0
	cbnz	w0, LBB0_6
LBB0_3:
	str	x26, [x23]
	mov	x0, x19
	bl	_o_rainit
	b	LBB0_8
LBB0_4:
Lloh6:
	adrp	x8, _EMFILE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EMFILE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _errno@GOTPAGE
Lloh10:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh11:
	str	w8, [x9]
	b	LBB0_7
LBB0_5:
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x21
	bl	_devopen
	mov	x21, x0
	cbz	w0, LBB0_9
LBB0_6:
	str	wzr, [x19]
Lloh12:
	adrp	x8, _errno@GOTPAGE
Lloh13:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh14:
	str	w21, [x8]
LBB0_7:
	mov	w20, #-1
LBB0_8:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_9:
	ldr	w8, [x19]
Lloh15:
	adrp	x24, _F_NODEV@GOTPAGE
Lloh16:
	ldr	x24, [x24, _F_NODEV@GOTPAGEOFF]
	ldr	w9, [x24]
	tst	w9, w8
	b.ne	LBB0_11
; %bb.10:
	ldr	x10, [x22]
	cbz	x10, LBB0_19
LBB0_11:
	ldr	x0, [sp, #8]
	cbz	x0, LBB0_18
; %bb.12:
	ldrb	w10, [x0]
	cbz	w10, LBB0_18
; %bb.13:
Lloh17:
	adrp	x10, _ENOENT@GOTPAGE
Lloh18:
	ldr	x10, [x10, _ENOENT@GOTPAGEOFF]
Lloh19:
	ldr	w21, [x10]
Lloh20:
	adrp	x25, _file_system@GOTPAGE
Lloh21:
	ldr	x25, [x25, _file_system@GOTPAGEOFF]
	ldr	x10, [x25]
	ldr	x26, [x10]
	cbz	x26, LBB0_21
; %bb.14:
	ldr	x8, [x26]
	mov	x1, x19
	blr	x8
	cbz	w0, LBB0_3
; %bb.15:
	mov	w27, #8
Lloh22:
	adrp	x28, _EINVAL@GOTPAGE
Lloh23:
	ldr	x28, [x28, _EINVAL@GOTPAGEOFF]
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x28]
	cmp	w0, w8
	csel	w21, w21, w0, eq
	ldr	x8, [x25]
	ldr	x26, [x8, x27]
	cbz	x26, LBB0_20
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x0, [sp, #8]
	ldr	x8, [x26]
	mov	x1, x19
	blr	x8
	add	x27, x27, #8
	cbnz	w0, LBB0_16
	b	LBB0_3
LBB0_18:
	sxtw	x9, w20
Lloh24:
	adrp	x10, _F_RAW@GOTPAGE
Lloh25:
	ldr	x10, [x10, _F_RAW@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	orr	w8, w10, w8
	str	w8, [x19]
	mov	w8, #48
	madd	x8, x9, x8, x25
	str	xzr, [x8, #24]
	b	LBB0_8
LBB0_19:
	mov	w21, #0
	b	LBB0_6
LBB0_20:
	ldr	w8, [x19]
	ldr	w9, [x24]
LBB0_21:
	tst	w9, w8
	b.ne	LBB0_24
; %bb.22:
	ldr	x8, [x22]
	cbz	x8, LBB0_24
; %bb.23:
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
LBB0_24:
	cbz	w21, LBB0_6
; %bb.25:
	mov	x0, x19
	bl	_devclose
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotStr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_EMFILE,4,2                     ; @EMFILE
	.comm	_errno,4,2                      ; @errno
	.comm	_files,8,3                      ; @files
	.comm	_exclusive_file_system,8,3      ; @exclusive_file_system
	.comm	_F_NODEV,4,2                    ; @F_NODEV
	.comm	_F_RAW,4,2                      ; @F_RAW
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_file_system,8,3                ; @file_system
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
