	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl28xxu_ctrl_msg
_rtl28xxu_ctrl_msg:                     ## @rtl28xxu_ctrl_msg
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %r15
	movq	16(%rdi), %r14
	leaq	8(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movl	(%r13), %edx
	cmpl	$5, %edx
	jb	LBB0_3
## %bb.1:
	movq	(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_2
LBB0_3:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	_CMD_WR_FLAG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r13)
	je	LBB0_5
## %bb.4:
	movl	(%r14), %edi
	movl	8(%r13), %esi
	callq	_memcpy
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rax
	movq	_USB_DIR_OUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movl	12(%r15), %edi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	jmp	LBB0_6
LBB0_5:
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rax
	movq	_USB_DIR_IN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movl	12(%r15), %edi
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
LBB0_6:
	movl	12(%r15), %edi
	movl	12(%r13), %r8d
	movl	(%r13), %r11d
	movl	4(%r13), %r9d
	movl	(%r14), %r10d
	subq	$8, %rsp
	movl	%eax, %esi
	xorl	%edx, %edx
	movl	%ebx, %ecx
	pushq	$1000                           ## imm = 0x3E8
	pushq	%r11
	pushq	%r10
	callq	_usb_control_msg
	addq	$32, %rsp
	movl	%eax, %r12d
	movl	12(%r15), %edi
	movl	12(%r13), %ecx
	movl	(%r13), %eax
	movl	4(%r13), %r8d
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	(%r14), %r9d
	subq	$8, %rsp
	xorl	%esi, %esi
	movl	%ebx, %edx
	pushq	%rax
	callq	_dvb_usb_dbg_usb_control_msg
	addq	$16, %rsp
	testl	%r12d, %r12d
	js	LBB0_7
## %bb.8:
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rax
	movq	_USB_DIR_IN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	cmpl	%ecx, %ebx
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_10
## %bb.9:
	movl	(%r13), %edx
	movl	8(%r13), %edi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	callq	_memcpy
LBB0_10:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	xorl	%r12d, %r12d
	jmp	LBB0_11
LBB0_7:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_2:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	(%r15), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%r12d, %edx
	callq	_dev_dbg
LBB0_11:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"too large message %u\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CMD_WR_FLAG,4,2                ## @CMD_WR_FLAG
	.comm	_USB_TYPE_VENDOR,4,2            ## @USB_TYPE_VENDOR
	.comm	_USB_DIR_OUT,4,2                ## @USB_DIR_OUT
	.comm	_USB_DIR_IN,4,2                 ## @USB_DIR_IN
L_.str.1:                               ## @.str.1
	.asciz	"failed=%d\n"

	.no_dead_strip	_rtl28xxu_ctrl_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl28xxu_ctrl_msg
_rtl28xxu_ctrl_msg:                     ; @rtl28xxu_ctrl_msg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x21, x1
	mov	x20, x0
	ldr	x24, [x0, #16]
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	w2, [x21]
	cmp	w2, #5
	b.lo	LBB0_2
; %bb.1:
	ldr	x0, [x20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_9
LBB0_2:
	ldr	w8, [x21, #4]
Lloh5:
	adrp	x9, _CMD_WR_FLAG@GOTPAGE
Lloh6:
	ldr	x9, [x9, _CMD_WR_FLAG@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	adrp	x25, _USB_TYPE_VENDOR@GOTPAGE
Lloh9:
	ldr	x25, [x25, _USB_TYPE_VENDOR@GOTPAGEOFF]
Lloh10:
	adrp	x26, _USB_DIR_IN@GOTPAGE
Lloh11:
	ldr	x26, [x26, _USB_DIR_IN@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	ldr	w0, [x24]
	ldr	w1, [x21, #8]
	bl	_memcpy
	ldr	w8, [x25]
Lloh12:
	adrp	x9, _USB_DIR_OUT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _USB_DIR_OUT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w22, w9, w8
	ldr	w0, [x20, #12]
	mov	w1, #0
	bl	_usb_sndctrlpipe
	b	LBB0_5
LBB0_4:
	ldr	w8, [x25]
	ldr	w9, [x26]
	orr	w22, w9, w8
	ldr	w0, [x20, #12]
	mov	w1, #0
	bl	_usb_rcvctrlpipe
LBB0_5:
	mov	x1, x0
	ldr	w0, [x20, #12]
	ldr	w4, [x21, #12]
	ldr	w6, [x24]
	ldp	w7, w5, [x21]
	mov	w8, #1000
	str	w8, [sp]
	mov	w2, #0
	mov	x3, x22
	bl	_usb_control_msg
	mov	x23, x0
	ldr	w0, [x20, #12]
	ldr	w3, [x21, #12]
	ldr	w5, [x24]
	ldp	w6, w4, [x21]
	mov	w1, #0
	mov	x2, x22
	bl	_dvb_usb_dbg_usb_control_msg
	tbnz	w23, #31, LBB0_9
; %bb.6:
	ldr	w8, [x25]
	ldr	w9, [x26]
	orr	w8, w9, w8
	cmp	w22, w8
	b.ne	LBB0_8
; %bb.7:
	ldr	w0, [x21, #8]
	ldr	w1, [x24]
	ldr	w2, [x21]
	bl	_memcpy
LBB0_8:
	mov	x0, x19
	bl	_mutex_unlock
	mov	w23, #0
	b	LBB0_10
LBB0_9:
	mov	x0, x19
	bl	_mutex_unlock
	ldr	x0, [x20]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x23
	bl	_dev_dbg
LBB0_10:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"too large message %u\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CMD_WR_FLAG,4,2                ; @CMD_WR_FLAG
	.comm	_USB_TYPE_VENDOR,4,2            ; @USB_TYPE_VENDOR
	.comm	_USB_DIR_OUT,4,2                ; @USB_DIR_OUT
	.comm	_USB_DIR_IN,4,2                 ; @USB_DIR_IN
l_.str.1:                               ; @.str.1
	.asciz	"failed=%d\n"

	.no_dead_strip	_rtl28xxu_ctrl_msg
.subsections_via_symbols
