	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function start_iq
LCPI0_0:
	.quad	2                               ## 0x2
	.quad	2                               ## 0x2
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_start_iq:                              ## @start_iq
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	8(%rdi), %r14
	movq	16(%r14), %r12
	movq	(%r14), %r13
	movq	%r12, %rdi
	callq	_mutex_lock
	cmpl	$0, (%r12)
	je	LBB0_1
LBB0_19:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r12, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	je	LBB0_16
## %bb.20:
	negl	%ebx
	jmp	LBB0_21
LBB0_1:
	movq	_SX8_DEMOD_NUM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_13
## %bb.2:
	movq	16(%r12), %rcx
	cmpl	$4, %eax
	jae	LBB0_4
## %bb.3:
	xorl	%edx, %edx
	xorl	%esi, %esi
	jmp	LBB0_11
LBB0_4:
	movl	%eax, %edx
	andl	$-4, %edx
	leaq	-4(%rdx), %rsi
	movq	%rsi, %rbx
	shrq	$2, %rbx
	incq	%rbx
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.6:
	movq	%rbx, %rsi
	andq	$-2, %rsi
	pxor	%xmm2, %xmm2
	xorl	%edi, %edi
	movdqa	LCPI0_0(%rip), %xmm3            ## xmm3 = [2,2]
	pxor	%xmm5, %xmm5
	pxor	%xmm4, %xmm4
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rcx,%rdi,8), %xmm6
	movdqu	16(%rcx,%rdi,8), %xmm7
	movdqu	32(%rcx,%rdi,8), %xmm0
	movdqu	48(%rcx,%rdi,8), %xmm1
	pcmpeqq	%xmm2, %xmm6
	paddq	%xmm5, %xmm6
	pcmpeqq	%xmm2, %xmm7
	paddq	%xmm4, %xmm7
	pcmpeqq	%xmm2, %xmm0
	pcmpeqq	%xmm2, %xmm1
	paddq	%xmm3, %xmm0
	paddq	%xmm6, %xmm0
	paddq	%xmm3, %xmm1
	paddq	%xmm7, %xmm1
	addq	$8, %rdi
	movdqa	%xmm0, %xmm5
	movdqa	%xmm1, %xmm4
	addq	$-2, %rsi
	jne	LBB0_7
## %bb.8:
	testb	$1, %bl
	je	LBB0_10
LBB0_9:
	movdqu	(%rcx,%rdi,8), %xmm2
	movdqu	16(%rcx,%rdi,8), %xmm3
	pxor	%xmm4, %xmm4
	pcmpeqq	%xmm4, %xmm2
	paddq	%xmm2, %xmm0
	pcmpeqq	%xmm4, %xmm3
	paddq	%xmm3, %xmm1
	pcmpeqd	%xmm2, %xmm2
	psubq	%xmm2, %xmm0
	psubq	%xmm2, %xmm1
LBB0_10:
	paddq	%xmm1, %xmm0
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	paddq	%xmm0, %xmm1
	movq	%xmm1, %rsi
	cmpq	%rax, %rdx
	je	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	cmpq	$1, (%rcx,%rdx,8)
	sbbq	$-1, %rsi
	incq	%rdx
	cmpq	%rdx, %rax
	jne	LBB0_11
LBB0_12:
	testq	%rsi, %rsi
	jne	LBB0_19
LBB0_13:
	movq	$0, 8(%r14)
	movq	8(%r12), %rax
	movl	(%rax,%r13,4), %ecx
	testl	%ecx, %ecx
	jne	LBB0_15
## %bb.14:
	movq	%r15, %rdi
	movq	%r13, %rsi
	movl	$1, %edx
	callq	_mci_set_tuner
	movq	8(%r12), %rax
	movl	(%rax,%r13,4), %ecx
LBB0_15:
	incl	%ecx
	movl	%ecx, (%rax,%r13,4)
	xorl	%eax, %eax
	cmpq	$2, -48(%rbp)                   ## 8-byte Folded Reload
	setge	%al
	movl	%eax, (%r12)
	movq	%r12, %rdi
	callq	_mutex_unlock
LBB0_16:
	leaq	-112(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$48, %edx
	callq	_memset
	movq	_SX8_CMD_START_IQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, -80(%rbp)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, -88(%rbp)
	imull	$1000, (%r15), %eax             ## imm = 0x3E8
	movl	%eax, -96(%rbp)
	movl	4(%r15), %eax
	movl	%eax, -92(%rbp)
	movdqu	(%r14), %xmm0
	movdqa	%xmm0, -112(%rbp)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_ddb_mci_cmd
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movq	%r15, %rdi
	callq	_stop
LBB0_18:
	movq	%r14, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_ddb_mci_config
LBB0_21:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	pxor	%xmm0, %xmm0
	xorl	%edi, %edi
	pxor	%xmm1, %xmm1
	testb	$1, %bl
	jne	LBB0_9
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_SX8_DEMOD_NUM,4,2              ## @SX8_DEMOD_NUM
	.comm	_SX8_CMD_START_IQ,4,2           ## @SX8_CMD_START_IQ
	.no_dead_strip	_start_iq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function start_iq
_start_iq:                              ; @start_iq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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, x3
	mov	x22, x2
	mov	x23, x1
	mov	x21, x0
	ldr	x20, [x0, #8]
	ldr	x24, [x20, #16]
	ldr	x25, [x20]
	mov	x0, x24
	bl	_mutex_lock
	ldr	w8, [x24]
	cbz	w8, LBB0_3
LBB0_1:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w25, [x8]
	mov	x0, x24
	bl	_mutex_unlock
	cbz	w25, LBB0_15
; %bb.2:
	neg	w22, w25
	b	LBB0_18
LBB0_3:
Lloh3:
	adrp	x8, _SX8_DEMOD_NUM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SX8_DEMOD_NUM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.4:
	ldr	x9, [x24, #16]
	cmp	w8, #8
	b.hs	LBB0_6
; %bb.5:
	mov	x10, #0
	mov	x11, #0
	b	LBB0_9
LBB0_6:
	and	x10, x8, #0xfffffff8
	add	x11, x9, #32
	movi.2d	v0, #0000000000000000
	mov	x12, x10
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q4, q5, [x11, #-32]
	ldp	q6, q7, [x11], #64
	cmtst.2d	v4, v4, v4
	cmtst.2d	v5, v5, v5
	cmtst.2d	v6, v6, v6
	cmtst.2d	v7, v7, v7
	sub.2d	v0, v0, v4
	sub.2d	v1, v1, v5
	sub.2d	v2, v2, v6
	sub.2d	v3, v3, v7
	subs	x12, x12, #8
	b.ne	LBB0_7
; %bb.8:
	add.2d	v0, v1, v0
	add.2d	v0, v2, v0
	add.2d	v0, v3, v0
	addp.2d	d0, v0
	fmov	x11, d0
	cmp	x10, x8
	b.eq	LBB0_11
LBB0_9:
	add	x9, x9, x10, lsl #3
	sub	x8, x8, x10
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9], #8
	cmp	x10, #0
	cinc	x11, x11, ne
	subs	x8, x8, #1
	b.ne	LBB0_10
LBB0_11:
	cbnz	x11, LBB0_1
LBB0_12:
	str	xzr, [x20, #8]
	ldr	x8, [x24, #8]
	ldr	w9, [x8, x25, lsl #2]
	cbnz	w9, LBB0_14
; %bb.13:
	mov	x0, x21
	mov	x1, x25
	mov	w2, #1
	bl	_mci_set_tuner
	ldr	x8, [x24, #8]
	ldr	w9, [x8, x25, lsl #2]
LBB0_14:
	add	w9, w9, #1
	str	w9, [x8, x25, lsl #2]
	cmp	x19, #1
	cset	w8, gt
	str	w8, [x24]
	mov	x0, x24
	bl	_mutex_unlock
LBB0_15:
	mov	x0, sp
	mov	w1, #0
	mov	w2, #48
	bl	_memset
Lloh6:
	adrp	x8, _SX8_CMD_START_IQ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SX8_CMD_START_IQ@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [sp, #40]
	stp	x22, x23, [sp, #24]
	mov	w8, #1000
	ldp	w9, w10, [x21]
	mul	w8, w9, w8
	stp	w8, w10, [sp, #16]
	ldr	q0, [x20]
	str	q0, [sp]
	mov	x1, sp
	mov	x0, x20
	mov	x2, #0
	bl	_ddb_mci_cmd
	mov	x22, x0
	cbz	w0, LBB0_17
; %bb.16:
	mov	x0, x21
	bl	_stop
LBB0_17:
	mov	x0, x20
	mov	x1, x19
	bl	_ddb_mci_config
LBB0_18:
	mov	x0, x22
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_SX8_DEMOD_NUM,4,2              ; @SX8_DEMOD_NUM
	.comm	_SX8_CMD_START_IQ,4,2           ; @SX8_CMD_START_IQ
	.no_dead_strip	_start_iq
.subsections_via_symbols
