	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function af9015_ctrl_msg
_af9015_ctrl_msg:                       ## @af9015_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, %rbx
	movq	%rdi, %r14
	callq	_d_to_priv
	movq	%rax, %r12
	movq	8(%r14), %r13
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%rbx), %eax
	movq	(%r12), %rdi
	movl	%eax, (%rdi)
	movl	8(%r12), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 8(%r12)
	movl	%eax, 4(%rdi)
	movl	4(%rbx), %eax
	addl	%eax, %eax
	movl	%eax, 8(%rdi)
	movl	8(%rbx), %ecx
	sarl	$8, %ecx
	movl	%ecx, 12(%rdi)
	movzbl	8(%rbx), %ecx
	movl	%ecx, 16(%rdi)
	movl	12(%rbx), %ecx
	movl	%ecx, 20(%rdi)
	movl	16(%rbx), %ecx
	movl	%ecx, 24(%rdi)
	movl	20(%rbx), %ecx
	movl	%ecx, 28(%rdi)
	movl	(%rbx), %edx
	leal	-128(%rdx), %ecx
	cmpl	$9, %ecx
	ja	LBB0_4
## %bb.1:
	leaq	LJTI0_0(%rip), %rdx
	movslq	(%rdx,%rcx,4), %rcx
	addq	%rdx, %rcx
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	jmpq	*%rcx
LBB0_2:
	movzbl	9(%rbx), %ecx
	shll	$8, %ecx
	movl	$128, %eax
	cmpl	$44544, %ecx                    ## imm = 0xAE00
	je	LBB0_7
## %bb.3:
	movzwl	%cx, %ecx
	cmpl	$65280, %ecx                    ## imm = 0xFF00
	je	LBB0_7
	jmp	LBB0_8
LBB0_4:
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r13, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	jmp	LBB0_5
LBB0_6:
	movq	_READ_WRITE_I2C@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_7:
	movl	%eax, (%rdi)
LBB0_8:
	movl	20(%rbx), %r13d
	movq	_BUF_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	$-8, %eax
	cmpl	%eax, %r13d
	jg	LBB0_12
## %bb.9:
	leal	8(%r13), %r15d
	addq	$32, %rdi
	movq	24(%rbx), %rsi
	movl	%r13d, %edx
	callq	_memcpy
	movl	$2, %r13d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_14
LBB0_10:
	orl	$1, %eax
	movl	%eax, 8(%rdi)
	movq	_READ_WRITE_I2C@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rdi)
LBB0_11:
	movl	20(%rbx), %r13d
	movq	_BUF_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	$-2, %eax
	cmpl	%eax, %r13d
	jle	LBB0_13
LBB0_12:
	movl	(%rbx), %edx
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_22
LBB0_13:
	addl	$2, %r13d
	movl	$8, %r15d
	movb	$1, %al
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
LBB0_14:
	movl	(%rbx), %eax
	orl	$4, %eax
	cmpl	$135, %eax
	jne	LBB0_16
## %bb.15:
	xorl	%r13d, %r13d
LBB0_16:
	movq	(%r12), %rcx
	movq	%r14, %rdi
	movq	%rcx, %rsi
	movl	%r15d, %edx
	movl	%r13d, %r8d
	callq	_dvb_usbv2_generic_rw_locked
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_22
## %bb.17:
	testl	%r13d, %r13d
	je	LBB0_20
## %bb.18:
	movq	(%r12), %rax
	movl	4(%rax), %edx
	testl	%edx, %edx
	je	LBB0_20
## %bb.19:
	leaq	L_.str.2(%rip), %rsi
	xorl	%r15d, %r15d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
LBB0_5:
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_22
LBB0_20:
	xorl	%r15d, %r15d
	cmpb	$0, -44(%rbp)                   ## 1-byte Folded Reload
	je	LBB0_22
## %bb.21:
	movq	24(%rbx), %rdi
	movq	(%r12), %rsi
	addq	$8, %rsi
	movl	20(%rbx), %edx
	callq	_memcpy
LBB0_22:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
LJTI0_0:
	.long	L0_0_set_8
	.long	L0_0_set_2
	.long	L0_0_set_6
	.long	L0_0_set_11
	.long	L0_0_set_11
	.long	L0_0_set_10
	.long	L0_0_set_11
	.long	L0_0_set_8
	.long	L0_0_set_8
	.long	L0_0_set_8
	.end_data_region
                                        ## -- End function
	.comm	_READ_WRITE_I2C,4,2             ## @READ_WRITE_I2C
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown cmd %d\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_BUF_LEN,4,2                    ## @BUF_LEN
L_.str.1:                               ## @.str.1
	.asciz	"too much data, cmd %u, len %u\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"cmd failed %u\n"

	.comm	_ACK_HDR_LEN,8,3                ## @ACK_HDR_LEN
	.comm	_REQ_HDR_LEN,8,3                ## @REQ_HDR_LEN
	.no_dead_strip	_af9015_ctrl_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function af9015_ctrl_msg
_af9015_ctrl_msg:                       ; @af9015_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	x19, x0
	bl	_d_to_priv
	mov	x22, x0
	ldr	x20, [x19, #8]
	mov	x0, x19
	bl	_mutex_lock
	ldr	w9, [x21]
	ldr	x8, [x22]
	str	w9, [x8]
	ldr	w9, [x22, #8]
	add	w10, w9, #1
	str	w10, [x22, #8]
	str	w9, [x8, #4]
	ldr	w9, [x21, #4]
	lsl	w9, w9, #1
	str	w9, [x8, #8]
	ldr	w10, [x21, #8]
	asr	w10, w10, #8
	str	w10, [x8, #12]
	ldrb	w10, [x21, #8]
	str	w10, [x8, #16]
	ldr	w10, [x21, #12]
	str	w10, [x8, #20]
	ldr	w10, [x21, #16]
	str	w10, [x8, #24]
	ldr	w10, [x21, #20]
	str	w10, [x8, #28]
	ldr	w2, [x21]
	sub	w10, w2, #128
	cmp	w10, #9
	b.hi	LBB0_4
; %bb.1:
Lloh0:
	adrp	x11, lJTI0_0@PAGE
Lloh1:
	add	x11, x11, lJTI0_0@PAGEOFF
	adr	x12, LBB0_2
	ldrb	w13, [x11, x10]
	add	x12, x12, x13, lsl #2
	br	x12
LBB0_2:
	ldrb	w9, [x21, #9]
	lsl	w10, w9, #8
	mov	w9, #128
	mov	w11, #44544
	cmp	w10, w11
	b.eq	LBB0_6
; %bb.3:
	mov	w11, #65280
	cmp	w10, w11
	b.eq	LBB0_6
	b	LBB0_7
LBB0_4:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_17
LBB0_5:
Lloh4:
	adrp	x9, _READ_WRITE_I2C@GOTPAGE
Lloh5:
	ldr	x9, [x9, _READ_WRITE_I2C@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
LBB0_6:
	str	w9, [x8]
LBB0_7:
	ldr	w2, [x21, #20]
Lloh7:
	adrp	x9, _BUF_LEN@GOTPAGE
Lloh8:
	ldr	x9, [x9, _BUF_LEN@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	sub	w9, w9, #8
	cmp	w2, w9
	b.gt	LBB0_11
; %bb.8:
	add	w23, w2, #8
	add	x0, x8, #32
	ldr	x1, [x21, #24]
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memcpy
	mov	w25, #0
	mov	w8, #2
	b	LBB0_13
LBB0_9:
	orr	w9, w9, #0x1
	str	w9, [x8, #8]
Lloh10:
	adrp	x9, _READ_WRITE_I2C@GOTPAGE
Lloh11:
	ldr	x9, [x9, _READ_WRITE_I2C@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	str	w9, [x8]
LBB0_10:
	ldr	w2, [x21, #20]
Lloh13:
	adrp	x8, _BUF_LEN@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BUF_LEN@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	sub	w8, w8, #2
	cmp	w2, w8
	b.le	LBB0_12
LBB0_11:
	ldr	w8, [x21]
	str	x2, [sp]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x8
	bl	_dev_err
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_18
LBB0_12:
	add	w8, w2, #2
	mov	w23, #8
	mov	w25, #1
LBB0_13:
	ldr	w9, [x21]
	orr	w9, w9, #0x4
	cmp	w9, #135
	csel	w24, wzr, w8, eq
	ldr	x1, [x22]
	mov	x0, x19
	mov	x2, x23
	mov	x3, x1
	mov	x4, x24
	bl	_dvb_usbv2_generic_rw_locked
	mov	x23, x0
	cbnz	w0, LBB0_19
; %bb.14:
	cbz	w24, LBB0_20
; %bb.15:
	ldr	x8, [x22]
	ldr	w2, [x8, #4]
	cbz	w2, LBB0_20
; %bb.16:
Lloh20:
	adrp	x1, l_.str.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_17:
	mov	x0, x20
	bl	_dev_err
Lloh22:
	adrp	x8, _EIO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_18:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_19:
	mov	x0, x19
	bl	_mutex_unlock
	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
LBB0_20:
	cbz	w25, LBB0_22
; %bb.21:
	ldr	x0, [x21, #24]
	ldr	x8, [x22]
	add	x1, x8, #8
	ldr	w2, [x21, #20]
	bl	_memcpy
LBB0_22:
	mov	w23, #0
	b	LBB0_19
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_7-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
	.byte	(LBB0_9-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
	.byte	(LBB0_7-LBB0_2)>>2
	.byte	(LBB0_7-LBB0_2)>>2
	.byte	(LBB0_7-LBB0_2)>>2
                                        ; -- End function
	.comm	_READ_WRITE_I2C,4,2             ; @READ_WRITE_I2C
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown cmd %d\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_BUF_LEN,4,2                    ; @BUF_LEN
l_.str.1:                               ; @.str.1
	.asciz	"too much data, cmd %u, len %u\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"cmd failed %u\n"

	.comm	_ACK_HDR_LEN,8,3                ; @ACK_HDR_LEN
	.comm	_REQ_HDR_LEN,8,3                ; @REQ_HDR_LEN
	.no_dead_strip	_af9015_ctrl_msg
.subsections_via_symbols
