	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dabusb_open
_dabusb_open:                           ## @dabusb_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	%rsi, %r15
	movq	%rdi, %rbx
	callq	_iminor
	movq	_DABUSB_MINOR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %ecx
	subl	%edx, %ecx
	jl	LBB0_2
## %bb.1:
	movq	_NRDABUSB@GOTPCREL(%rip), %rsi
	addl	(%rsi), %edx
	cmpl	%edx, %eax
	jge	LBB0_2
## %bb.4:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	_dabusb@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movslq	%ecx, %rbx
	shlq	$4, %rbx
	leaq	(%r14,%rbx), %r12
	leaq	L_.str(%rip), %rdi
	callq	_dbg
	addq	%r14, %rbx
	addq	$4, %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	_O_NONBLOCK@GOTPCREL(%rip), %r13
	movq	_current@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	4(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$0, (%r12)
	je	LBB0_12
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	(%r13), %eax
	testl	%eax, (%r15)
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$500, %edi                      ## imm = 0x1F4
	callq	_msleep_interruptible
	movl	(%r14), %edi
	callq	_signal_pending
	testq	%rax, %rax
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	callq	_mutex_lock
	jmp	LBB0_5
LBB0_2:
	movq	_EIO@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_10:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_12:
	movq	__DABUSB_IF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_usb_set_interface
	testq	%rax, %rax
	js	LBB0_13
## %bb.14:
	movl	$1, (%r12)
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	$0, 16(%r15)
	movq	%r12, 8(%r15)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nonseekable_open               ## TAILCALL
LBB0_13:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	4(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_DABUSB_MINOR,4,2               ## @DABUSB_MINOR
	.comm	_NRDABUSB,4,2                   ## @NRDABUSB
	.comm	_EIO,4,2                        ## @EIO
	.comm	_dabusb,8,3                     ## @dabusb
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dabusb_open"

	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_current,4,2                    ## @current
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	__DABUSB_IF,4,2                 ## @_DABUSB_IF
L_.str.1:                               ## @.str.1
	.asciz	"set_interface failed\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_dabusb_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dabusb_open
_dabusb_open:                           ; @dabusb_open
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	mov	x20, x0
	bl	_iminor
Lloh0:
	adrp	x8, _DABUSB_MINOR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DABUSB_MINOR@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
	subs	w8, w0, w9
	b.lt	LBB0_7
; %bb.1:
Lloh3:
	adrp	x10, _NRDABUSB@GOTPAGE
Lloh4:
	ldr	x10, [x10, _NRDABUSB@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	add	w9, w10, w9
	cmp	w0, w9
	b.ge	LBB0_7
; %bb.2:
Lloh6:
	adrp	x9, _dabusb@GOTPAGE
Lloh7:
	ldr	x9, [x9, _dabusb@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x22, x9, w8, sxtw #4
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dbg
	add	x21, x22, #4
	mov	x0, x21
	bl	_mutex_lock
	add	x23, x22, #8
Lloh11:
	adrp	x24, _O_NONBLOCK@GOTPAGE
Lloh12:
	ldr	x24, [x24, _O_NONBLOCK@GOTPAGEOFF]
Lloh13:
	adrp	x25, _current@GOTPAGE
Lloh14:
	ldr	x25, [x25, _current@GOTPAGEOFF]
	ldr	x0, [x23]
	cbz	x0, LBB0_4
LBB0_3:
	ldr	w8, [x22]
	cbz	w8, LBB0_11
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_mutex_unlock
	ldr	w8, [x19]
	ldr	w9, [x24]
	tst	w9, w8
	b.ne	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #500
	bl	_msleep_interruptible
	ldr	w0, [x25]
	bl	_signal_pending
	cbnz	x0, LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	bl	_mutex_lock
	ldr	x0, [x23]
	cbnz	x0, LBB0_3
	b	LBB0_4
LBB0_7:
Lloh15:
	adrp	x8, _EIO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_9:
Lloh17:
	adrp	x8, _EBUSY@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_8
LBB0_10:
Lloh19:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_8
LBB0_11:
Lloh21:
	adrp	x8, __DABUSB_IF@GOTPAGE
Lloh22:
	ldr	x8, [x8, __DABUSB_IF@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	w24, #1
	mov	w2, #1
	bl	_usb_set_interface
	tbnz	x0, #63, LBB0_13
; %bb.12:
	str	w24, [x22]
	mov	x0, x21
	bl	_mutex_unlock
	stp	x22, xzr, [x19, #8]
	mov	x0, x20
	mov	x1, 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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_nonseekable_open
LBB0_13:
	mov	x0, x21
	bl	_mutex_unlock
	ldr	x0, [x23]
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_DABUSB_MINOR,4,2               ; @DABUSB_MINOR
	.comm	_NRDABUSB,4,2                   ; @NRDABUSB
	.comm	_EIO,4,2                        ; @EIO
	.comm	_dabusb,8,3                     ; @dabusb
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dabusb_open"

	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_current,4,2                    ; @current
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	__DABUSB_IF,4,2                 ; @_DABUSB_IF
l_.str.1:                               ; @.str.1
	.asciz	"set_interface failed\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_dabusb_open
.subsections_via_symbols
