	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxusb_medion_get               ## -- Begin function cxusb_medion_get
	.p2align	4, 0x90
_cxusb_medion_get:                      ## @cxusb_medion_get
	.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
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	8(%rdi), %r13
	leaq	12(%r13), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	(%r13), %rax
	movq	_CXUSB_OPEN_INIT@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	je	LBB0_2
## %bb.1:
	xorl	%edi, %edi
	movq	_CXUSB_OPEN_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
LBB0_2:
	xorl	%edi, %edi
	cmpl	$0, 8(%r13)
	setne	%dil
LBB0_3:
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_24
LBB0_5:
	movq	(%r13), %rax
	cmpq	(%rbx), %rax
	jne	LBB0_7
## %bb.6:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_24
LBB0_7:
	movl	8(%r13), %ecx
	movl	%r15d, %edx
	testl	%ecx, %ecx
	je	LBB0_8
## %bb.21:
	cmpq	%rdx, %rax
	jne	LBB0_23
## %bb.22:
	incl	%ecx
	movl	%ecx, 8(%r13)
	movq	_CXUSB_OPEN_ANALOG@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rsi
	cmoveq	%rax, %rsi
	leaq	L_.str.6(%rip), %rdi
	callq	_deb_info
	xorl	%ebx, %ebx
	jmp	LBB0_25
LBB0_8:
	movq	_CXUSB_OPEN_ANALOG@GOTPCREL(%rip), %rbx
	cmpl	%r15d, (%rbx)
	leaq	L_.str.1(%rip), %rcx
	leaq	L_.str.2(%rip), %rsi
	cmoveq	%rcx, %rsi
	cmpq	%rdx, %rax
	jne	LBB0_9
## %bb.19:
	leaq	L_.str.5(%rip), %rdi
	callq	_deb_info
LBB0_20:
	movl	$1, 8(%r13)
	xorl	%ebx, %ebx
	jmp	LBB0_25
LBB0_23:
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_24:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_25:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	leaq	L_.str(%rip), %rdi
	callq	_deb_info
	movl	(%rbx), %ebx
	movq	%r12, %rdi
	movl	$1, %esi
	callq	__cxusb_power_ctrl
	cmpl	%r15d, %ebx
	jne	LBB0_14
## %bb.10:
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movq	(%r12), %rdi
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_warn
LBB0_12:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_cxusb_medion_set_mode
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_25
## %bb.13:
	movq	%r12, %rdi
	callq	_cxusb_medion_analog_init
	jmp	LBB0_17
LBB0_14:
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	movq	(%r12), %rdi
	leaq	L_.str.4(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_warn
LBB0_16:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_cxusb_medion_set_mode
LBB0_17:
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_25
## %bb.18:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r13)
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_CXUSB_OPEN_INIT,8,3            ## @CXUSB_OPEN_INIT
	.comm	_CXUSB_OPEN_NONE,8,3            ## @CXUSB_OPEN_NONE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"will acquire and switch to %s\n"

	.comm	_CXUSB_OPEN_ANALOG,4,2          ## @CXUSB_OPEN_ANALOG
L_.str.1:                               ## @.str.1
	.asciz	"analog"

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

L_.str.3:                               ## @.str.3
	.asciz	"powerup for analog switch failed (%d)\n"

L_.str.4:                               ## @.str.4
	.asciz	"powerup for digital switch failed (%d)\n"

L_.str.5:                               ## @.str.5
	.asciz	"reacquired idle %s\n"

L_.str.6:                               ## @.str.6
	.asciz	"acquired %s\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxusb_medion_get               ; -- Begin function cxusb_medion_get
	.p2align	2
_cxusb_medion_get:                      ; @cxusb_medion_get
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x1
	mov	x20, x0
	ldr	x22, [x0, #8]
	add	x19, x22, #12
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x22]
Lloh0:
	adrp	x23, _CXUSB_OPEN_INIT@GOTPAGE
Lloh1:
	ldr	x23, [x23, _CXUSB_OPEN_INIT@GOTPAGEOFF]
	ldr	x9, [x23]
Lloh2:
	adrp	x10, _CXUSB_OPEN_NONE@GOTPAGE
Lloh3:
	ldr	x10, [x10, _CXUSB_OPEN_NONE@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_3
; %bb.1:
	ldr	w8, [x22, #8]
	cmp	w8, #0
	cset	w0, ne
	bl	_WARN_ON
	cbz	x0, LBB0_4
LBB0_2:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_13
LBB0_3:
	mov	w0, #0
	bl	_WARN_ON
	cbnz	x0, LBB0_2
LBB0_4:
	ldr	x8, [x22]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
Lloh7:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_13
LBB0_6:
	ldr	w9, [x22, #8]
	mov	w23, w21
	cbz	w9, LBB0_9
; %bb.7:
	cmp	x8, x23
	b.ne	LBB0_12
; %bb.8:
	add	w8, w9, #1
	str	w8, [x22, #8]
Lloh9:
	adrp	x8, _CXUSB_OPEN_ANALOG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CXUSB_OPEN_ANALOG@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, l_.str.2@PAGE
Lloh13:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh14:
	adrp	x10, l_.str.1@PAGE
Lloh15:
	add	x10, x10, l_.str.1@PAGEOFF
	cmp	w8, w21
	csel	x1, x10, x9, eq
Lloh16:
	adrp	x0, l_.str.6@PAGE
Lloh17:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_deb_info
	mov	w21, #0
	b	LBB0_14
LBB0_9:
Lloh18:
	adrp	x24, _CXUSB_OPEN_ANALOG@GOTPAGE
Lloh19:
	ldr	x24, [x24, _CXUSB_OPEN_ANALOG@GOTPAGEOFF]
Lloh20:
	adrp	x9, l_.str.2@PAGE
Lloh21:
	add	x9, x9, l_.str.2@PAGEOFF
	ldr	w10, [x24]
Lloh22:
	adrp	x11, l_.str.1@PAGE
Lloh23:
	add	x11, x11, l_.str.1@PAGEOFF
	cmp	w10, w21
	csel	x1, x11, x9, eq
	cmp	x8, x23
	b.ne	LBB0_15
; %bb.10:
Lloh24:
	adrp	x0, l_.str.5@PAGE
Lloh25:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_deb_info
LBB0_11:
	mov	w21, #0
	mov	w8, #1
	str	w8, [x22, #8]
	b	LBB0_14
LBB0_12:
Lloh26:
	adrp	x8, _EBUSY@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_14:
	mov	x0, x19
	bl	_mutex_unlock
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_15:
Lloh28:
	adrp	x0, l_.str@PAGE
Lloh29:
	add	x0, x0, l_.str@PAGEOFF
	bl	_deb_info
	ldr	w24, [x24]
	mov	x0, x20
	mov	w1, #1
	bl	__cxusb_power_ctrl
	mov	x2, x0
	cmp	w24, w21
	b.ne	LBB0_20
; %bb.16:
	cbz	w2, LBB0_18
; %bb.17:
	ldr	x0, [x20]
Lloh30:
	adrp	x1, l_.str.3@PAGE
Lloh31:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_warn
LBB0_18:
	mov	x0, x20
	mov	w1, #0
	bl	_cxusb_medion_set_mode
	mov	x21, x0
	cbnz	w0, LBB0_14
; %bb.19:
	mov	x0, x20
	bl	_cxusb_medion_analog_init
	b	LBB0_23
LBB0_20:
	cbz	w2, LBB0_22
; %bb.21:
	ldr	x0, [x20]
Lloh32:
	adrp	x1, l_.str.4@PAGE
Lloh33:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_warn
LBB0_22:
	mov	x0, x20
	mov	w1, #1
	bl	_cxusb_medion_set_mode
LBB0_23:
	mov	x21, x0
	cbnz	w0, LBB0_14
; %bb.24:
	str	x23, [x22]
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_CXUSB_OPEN_INIT,8,3            ; @CXUSB_OPEN_INIT
	.comm	_CXUSB_OPEN_NONE,8,3            ; @CXUSB_OPEN_NONE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"will acquire and switch to %s\n"

	.comm	_CXUSB_OPEN_ANALOG,4,2          ; @CXUSB_OPEN_ANALOG
l_.str.1:                               ; @.str.1
	.asciz	"analog"

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

l_.str.3:                               ; @.str.3
	.asciz	"powerup for analog switch failed (%d)\n"

l_.str.4:                               ; @.str.4
	.asciz	"powerup for digital switch failed (%d)\n"

l_.str.5:                               ; @.str.5
	.asciz	"reacquired idle %s\n"

l_.str.6:                               ; @.str.6
	.asciz	"acquired %s\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
.subsections_via_symbols
