	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function open
_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movslq	(%rdi), %rdi
	testq	%rdi, %rdi
	js	LBB0_8
## %bb.1:
	movq	_slgt_device_count@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edi
	jge	LBB0_8
## %bb.2:
	movq	%rsi, %r15
	movq	_slgt_device_list@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_5
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%edi, (%rbx)
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	56(%rbx), %rbx
	testq	%rbx, %rbx
	jne	LBB0_3
LBB0_5:
	xorl	%ebx, %ebx
LBB0_6:
	movl	24(%r14), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	callq	_sanity_check
	testq	%rax, %rax
	jne	LBB0_9
## %bb.7:
	movq	48(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
LBB0_8:
	callq	_DBGERR
LBB0_9:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_10:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	%rbx, 16(%r14)
	movq	%r14, 16(%rbx)
	movslq	8(%rbx), %rdi
	callq	_DBGINFO
	movq	%r15, %rdi
	callq	_tty_hung_up_p
	movl	12(%rbx), %ecx
	movq	_ASYNC_CLOSING@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	testl	%ecx, %edx
	jne	LBB0_14
	jmp	LBB0_15
LBB0_13:
	testl	%ecx, %edx
	je	LBB0_24
LBB0_14:
	leaq	24(%rbx), %rdi
	callq	_interruptible_sleep_on
	movl	12(%rbx), %ecx
LBB0_15:
	movq	_ASYNC_HUP_NOTIFY@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	jne	LBB0_17
## %bb.16:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_17:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
LBB0_18:
	movl	(%rax), %r12d
	testl	%r12d, %r12d
	je	LBB0_30
LBB0_19:
	negl	%r12d
LBB0_20:
	cmpl	$1, 8(%r14)
	jne	LBB0_22
## %bb.21:
	movq	$0, 16(%rbx)
LBB0_22:
	movl	8(%rbx), %eax
	testl	%eax, %eax
	je	LBB0_31
## %bb.23:
	decl	%eax
	movl	%eax, 8(%rbx)
	jmp	LBB0_31
LBB0_24:
	movslq	%ecx, %rax
	movq	_ASYNC_LOW_LATENCY@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	andq	(%rcx), %rax
	setne	%dl
	movq	16(%rbx), %rax
	movl	%edx, 4(%rax)
	leaq	32(%rbx), %r13
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	cmpq	$0, 40(%rbx)
	je	LBB0_26
## %bb.25:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	testl	%r12d, %r12d
	jne	LBB0_19
	jmp	LBB0_30
LBB0_26:
	incl	8(%rbx)
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	cmpl	$1, 8(%rbx)
	jne	LBB0_28
## %bb.27:
	movq	%rbx, %rdi
	callq	_startup
	testl	%eax, %eax
	js	LBB0_32
LBB0_28:
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_block_til_ready
	testl	%eax, %eax
	je	LBB0_30
## %bb.29:
	movl	%eax, %r12d
	movslq	%eax, %rdi
	callq	_DBGINFO
	jmp	LBB0_20
LBB0_30:
	xorl	%r12d, %r12d
LBB0_31:
	movslq	%r12d, %rdi
	callq	_DBGINFO
	jmp	LBB0_10
LBB0_32:
	movl	%eax, %r12d
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_slgt_device_count,4,2          ## @slgt_device_count
	.comm	_driver_name,4,2                ## @driver_name
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_slgt_device_list,8,3           ## @slgt_device_list
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"open"

	.comm	_ASYNC_CLOSING,4,2              ## @ASYNC_CLOSING
	.comm	_ASYNC_HUP_NOTIFY,4,2           ## @ASYNC_HUP_NOTIFY
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_ASYNC_LOW_LATENCY,8,3          ## @ASYNC_LOW_LATENCY
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function open
_open:                                  ; @open
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x0
	ldr	w8, [x0]
	sxtw	x0, w8
	tbnz	w8, #31, LBB0_7
; %bb.1:
Lloh0:
	adrp	x9, _slgt_device_count@GOTPAGE
Lloh1:
	ldr	x9, [x9, _slgt_device_count@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ge	LBB0_7
; %bb.2:
	mov	x21, x1
Lloh3:
	adrp	x8, _slgt_device_list@GOTPAGE
Lloh4:
	ldr	x8, [x8, _slgt_device_list@GOTPAGEOFF]
Lloh5:
	ldr	x20, [x8]
	cbz	x20, LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20]
	cmp	w8, w0
	b.eq	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x20, [x20, #56]
	cbnz	x20, LBB0_3
LBB0_5:
	ldr	w1, [x19, #24]
Lloh6:
	adrp	x2, l_.str.1@PAGE
Lloh7:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_sanity_check
	cbnz	x0, LBB0_8
; %bb.6:
	ldr	x0, [x20, #48]
	cbz	x0, LBB0_10
LBB0_7:
	bl	_DBGERR
LBB0_8:
Lloh8:
	adrp	x8, _ENODEV@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_9:
	mov	x0, x22
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_10:
	str	x20, [x19, #16]
	str	x19, [x20, #16]
	ldrsw	x0, [x20, #8]
	bl	_DBGINFO
	mov	x0, x21
	bl	_tty_hung_up_p
	ldr	w8, [x20, #12]
Lloh11:
	adrp	x9, _ASYNC_CLOSING@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ASYNC_CLOSING@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	and	w9, w9, w8
	cbz	x0, LBB0_12
; %bb.11:
	cbnz	w9, LBB0_13
	b	LBB0_14
LBB0_12:
	cbz	w9, LBB0_20
LBB0_13:
	add	x0, x20, #24
	bl	_interruptible_sleep_on
	ldr	w8, [x20, #12]
LBB0_14:
Lloh14:
	adrp	x9, _ASYNC_HUP_NOTIFY@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ASYNC_HUP_NOTIFY@GOTPAGEOFF]
Lloh16:
	adrp	x10, _EAGAIN@GOTPAGE
Lloh17:
	ldr	x10, [x10, _EAGAIN@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
Lloh19:
	adrp	x11, _ERESTARTSYS@GOTPAGE
Lloh20:
	ldr	x11, [x11, _ERESTARTSYS@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x11, x10, eq
	ldr	w21, [x8]
	cbz	w21, LBB0_22
LBB0_15:
	neg	w22, w21
LBB0_16:
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.ne	LBB0_18
; %bb.17:
	str	xzr, [x20, #16]
LBB0_18:
	ldr	w8, [x20, #8]
	cbz	w8, LBB0_23
; %bb.19:
	sub	w8, w8, #1
	str	w8, [x20, #8]
	b	LBB0_23
LBB0_20:
	sxtw	x8, w8
Lloh21:
	adrp	x9, _ASYNC_LOW_LATENCY@GOTPAGE
Lloh22:
	ldr	x9, [x9, _ASYNC_LOW_LATENCY@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	tst	x9, x8
	cset	w8, ne
	ldr	x9, [x20, #16]
	str	w8, [x9, #4]
	add	x22, x20, #32
	mov	x0, x22
	bl	_spin_lock_irqsave
	ldr	x8, [x20, #40]
	cbz	x8, LBB0_24
; %bb.21:
Lloh24:
	adrp	x8, _EBUSY@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh26:
	ldr	w21, [x8]
	mov	x0, x22
	bl	_spin_unlock_irqrestore
	cbnz	w21, LBB0_15
LBB0_22:
	mov	w22, #0
LBB0_23:
	sxtw	x0, w22
	bl	_DBGINFO
	b	LBB0_9
LBB0_24:
	ldr	w8, [x20, #8]
	add	w8, w8, #1
	str	w8, [x20, #8]
	mov	x0, x22
	bl	_spin_unlock_irqrestore
	ldr	w8, [x20, #8]
	cmp	w8, #1
	b.ne	LBB0_26
; %bb.25:
	mov	x0, x20
	bl	_startup
	tbnz	w0, #31, LBB0_28
LBB0_26:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_block_til_ready
	mov	x22, x0
	cbz	w0, LBB0_23
; %bb.27:
	sxtw	x0, w22
	bl	_DBGINFO
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	b	LBB0_16
LBB0_28:
	mov	x22, x0
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_slgt_device_count,4,2          ; @slgt_device_count
	.comm	_driver_name,4,2                ; @driver_name
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_slgt_device_list,8,3           ; @slgt_device_list
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"open"

	.comm	_ASYNC_CLOSING,4,2              ; @ASYNC_CLOSING
	.comm	_ASYNC_HUP_NOTIFY,4,2           ; @ASYNC_HUP_NOTIFY
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_ASYNC_LOW_LATENCY,8,3          ; @ASYNC_LOW_LATENCY
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_open
.subsections_via_symbols
