	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ctrl_set_channel
_ctrl_set_channel:                      ## @ctrl_set_channel
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	%rsi, %r14
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.4:
	movq	%rdi, %r12
	movq	(%rdi), %rdx
	movl	(%rdx), %r15d
	leal	-129(%r15), %r13d
	cmpl	$4, %r13d
	jae	LBB0_2
## %bb.5:
	movq	8(%r12), %rdi
	cmpl	$130, %r15d
	je	LBB0_8
## %bb.6:
	cmpl	$132, %r15d
	je	LBB0_8
## %bb.7:
	movq	_DRX_STANDARD_NTSC@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jne	LBB0_11
LBB0_8:
	movl	(%r14), %eax
	cmpl	$161, %eax
	je	LBB0_10
## %bb.9:
	cmpl	$158, %eax
	jne	LBB0_2
LBB0_10:
	movl	$161, (%r14)
LBB0_11:
	movl	%r15d, %eax
	andl	$-3, %eax
	cmpl	$129, %eax
	jne	LBB0_19
## %bb.12:
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	cmpl	$131, %r15d
	sete	-41(%rbp)                       ## 1-byte Folded Spill
	movq	_DRX_UIO1@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	%rax, -80(%rbp)
	movq	_DRX_UIO_MODE_FIRMWARE_SAW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)
	movq	_DRXJ_QAM_SYMBOLRATE_MIN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	_DRXJ_QAM_SYMBOLRATE_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	leaq	-80(%rbp), %rsi
	movq	%r12, %rdi
	callq	_ctrl_set_uio_cfg
	testl	%eax, %eax
	jne	LBB0_40
## %bb.13:
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movb	-41(%rbp), %dl                  ## 1-byte Reload
	movq	8(%r14), %rax
	cmpq	-96(%rbp), %rax                 ## 8-byte Folded Reload
	jl	LBB0_2
## %bb.14:
	cmpq	%rcx, %rax
	jg	LBB0_2
## %bb.15:
	movl	$-152, %ecx
	addl	16(%r14), %ecx
	cmpl	$4, %ecx
	ja	LBB0_2
## %bb.16:
	xorl	%ecx, %ecx
	movb	%dl, %cl
	addq	%rcx, %rcx
	addq	$113, %rcx
	imulq	%rcx, %rax
	movslq	%eax, %rcx
	imulq	$1374389535, %rcx, %rdx         ## imm = 0x51EB851F
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$37, %rdx
	addl	%eax, %edx
	imull	$100, %edx, %eax
	subl	%eax, %ecx
	xorl	%eax, %eax
	cmpl	$50, %ecx
	setge	%al
	addl	%edx, %eax
	cmpl	$6100000, %eax                  ## imm = 0x5D1420
	jg	LBB0_36
## %bb.17:
	movl	$161, (%r14)
	jmp	LBB0_18
LBB0_36:
	cmpl	$7100000, %eax                  ## imm = 0x6C5660
	ja	LBB0_38
## %bb.37:
	movl	$160, (%r14)
	jmp	LBB0_18
LBB0_38:
	movl	$159, (%r14)
LBB0_18:
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
LBB0_19:
	cmpl	$130, %r15d
	jne	LBB0_23
## %bb.20:
	movl	$-152, %eax
	addl	16(%r14), %eax
	cmpl	$5, %eax
	ja	LBB0_2
## %bb.21:
	movl	$37, %ecx
	btl	%eax, %ecx
	jae	LBB0_2
## %bb.22:
	movl	$-133, %eax
	addl	20(%r14), %eax
	cmpl	$19, %eax
	jae	LBB0_2
LBB0_23:
	movq	8(%rdx), %rax
	movq	_DRX_UIO_MODE_FIRMWARE_SAW@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_27
## %bb.24:
	movq	_DRX_UIO1@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -80(%rbp)
	movl	$0, -72(%rbp)
	movl	$-159, %eax
	addl	(%r14), %eax
	cmpl	$3, %eax
	jae	LBB0_2
## %bb.25:
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	cltq
	leaq	l_switch.table.ctrl_set_channel(%rip), %rcx
	movl	(%rcx,%rax,4), %eax
	movl	%eax, -76(%rbp)
	leaq	-80(%rbp), %rsi
	movq	%r12, %rdi
	callq	_ctrl_uio_write
	testl	%eax, %eax
	jne	LBB0_40
## %bb.26:
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
LBB0_27:
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	_SCU_COMM_EXEC__A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SCU_COMM_EXEC_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ecx, %ecx
	callq	_drxj_dap_write_reg16
	testl	%eax, %eax
	jne	LBB0_40
## %bb.28:
	cmpl	$3, %r13d
	jae	LBB0_29
## %bb.39:
	movq	%r12, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_set_qam_channel
	testl	%eax, %eax
	jne	LBB0_40
LBB0_35:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	$1, 16(%rax)
	xorl	%ebx, %ebx
	jmp	LBB0_41
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_41:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_29:
	cmpl	$132, %r15d
	jne	LBB0_42
## %bb.30:
	movl	24(%r14), %eax
	movq	_DRX_MIRROR_AUTO@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_32
## %bb.31:
	movq	_DRX_MIRROR_NO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_32:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, 20(%rcx)
	movq	%r12, %rdi
	callq	_set_vsb
	testl	%eax, %eax
	jne	LBB0_40
## %bb.33:
	movq	%r12, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_set_frequency
	testl	%eax, %eax
	je	LBB0_35
LBB0_40:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_err
	jmp	LBB0_41
LBB0_42:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DRX_STANDARD_NTSC,4,2          ## @DRX_STANDARD_NTSC
	.comm	_DRX_UIO1,4,2                   ## @DRX_UIO1
	.comm	_DRX_UIO_MODE_FIRMWARE_SAW,8,3  ## @DRX_UIO_MODE_FIRMWARE_SAW
	.comm	_DRXJ_QAM_SYMBOLRATE_MIN,8,3    ## @DRXJ_QAM_SYMBOLRATE_MIN
	.comm	_DRXJ_QAM_SYMBOLRATE_MAX,8,3    ## @DRXJ_QAM_SYMBOLRATE_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error %d\n"

	.comm	_SCU_COMM_EXEC__A,4,2           ## @SCU_COMM_EXEC__A
	.comm	_SCU_COMM_EXEC_ACTIVE,4,2       ## @SCU_COMM_EXEC_ACTIVE
	.comm	_DRX_MIRROR_AUTO,4,2            ## @DRX_MIRROR_AUTO
	.comm	_DRX_MIRROR_NO,4,2              ## @DRX_MIRROR_NO
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_ctrl_set_channel
	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.ctrl_set_channel
l_switch.table.ctrl_set_channel:
	.long	1                               ## 0x1
	.long	0                               ## 0x0
	.long	0                               ## 0x0

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ctrl_set_channel
_ctrl_set_channel:                      ; @ctrl_set_channel
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	cbz	x0, LBB0_29
; %bb.1:
	mov	x19, x1
	cbz	x1, LBB0_29
; %bb.2:
	mov	x20, x0
	ldr	x23, [x0]
	ldr	w24, [x23]
	sub	w25, w24, #129
	cmp	w25, #4
	b.hs	LBB0_29
; %bb.3:
	ldr	x21, [x20, #8]
	cmp	w24, #130
	b.eq	LBB0_6
; %bb.4:
	cmp	w24, #132
	b.eq	LBB0_6
; %bb.5:
Lloh0:
	adrp	x8, _DRX_STANDARD_NTSC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRX_STANDARD_NTSC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w24, w8
	b.ne	LBB0_9
LBB0_6:
	ldr	w8, [x19]
	cmp	w8, #161
	b.eq	LBB0_8
; %bb.7:
	cmp	w8, #158
	b.ne	LBB0_29
LBB0_8:
	mov	w8, #161
	str	w8, [x19]
LBB0_9:
	and	w8, w24, #0xfffffffd
	cmp	w8, #129
	b.ne	LBB0_20
; %bb.10:
Lloh3:
	adrp	x8, _DRX_UIO1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DRX_UIO1@GOTPAGEOFF]
Lloh5:
	ldrsw	x8, [x8]
	str	x8, [sp]
Lloh6:
	adrp	x8, _DRX_UIO_MODE_FIRMWARE_SAW@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DRX_UIO_MODE_FIRMWARE_SAW@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	str	w8, [sp, #8]
	cmp	w24, #131
	mov	w8, #113
	mov	w9, #115
	csel	x26, x9, x8, eq
Lloh9:
	adrp	x8, _DRXJ_QAM_SYMBOLRATE_MIN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DRXJ_QAM_SYMBOLRATE_MIN@GOTPAGEOFF]
Lloh11:
	ldr	x28, [x8]
Lloh12:
	adrp	x8, _DRXJ_QAM_SYMBOLRATE_MAX@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DRXJ_QAM_SYMBOLRATE_MAX@GOTPAGEOFF]
Lloh14:
	ldr	x27, [x8]
	mov	x1, sp
	mov	x0, x20
	bl	_ctrl_set_uio_cfg
	cbnz	w0, LBB0_28
; %bb.11:
	ldr	x8, [x19, #8]
	cmp	x8, x28
	b.lt	LBB0_29
; %bb.12:
	cmp	x8, x27
	b.gt	LBB0_29
; %bb.13:
	ldr	w9, [x19, #16]
	sub	w9, w9, #152
	cmp	w9, #4
	b.hi	LBB0_29
; %bb.14:
	mul	w8, w8, w26
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	smull	x9, w8, w9
	lsr	x10, x9, #63
	asr	x9, x9, #37
	add	w9, w9, w10
	mov	w10, #100
	msub	w8, w9, w10, w8
	cmp	w8, #49
	cinc	w8, w9, gt
	mov	w9, #5152
	movk	w9, #93, lsl #16
	cmp	w8, w9
	b.gt	LBB0_16
; %bb.15:
	mov	w8, #161
	b	LBB0_19
LBB0_16:
	mov	w9, #22112
	movk	w9, #108, lsl #16
	cmp	w8, w9
	b.hi	LBB0_18
; %bb.17:
	mov	w8, #160
	b	LBB0_19
LBB0_18:
	mov	w8, #159
LBB0_19:
	str	w8, [x19]
LBB0_20:
	cmp	w24, #130
	b.ne	LBB0_24
; %bb.21:
	ldr	w8, [x19, #16]
	sub	w8, w8, #152
	cmp	w8, #5
	b.hi	LBB0_29
; %bb.22:
	mov	w9, #1
	lsl	w8, w9, w8
	mov	w9, #37
	tst	w8, w9
	b.eq	LBB0_29
; %bb.23:
	ldr	w8, [x19, #20]
	sub	w8, w8, #133
	cmp	w8, #19
	b.hs	LBB0_29
LBB0_24:
	ldr	x8, [x23, #8]
Lloh15:
	adrp	x9, _DRX_UIO_MODE_FIRMWARE_SAW@GOTPAGE
Lloh16:
	ldr	x9, [x9, _DRX_UIO_MODE_FIRMWARE_SAW@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_27
; %bb.25:
Lloh18:
	adrp	x8, _DRX_UIO1@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DRX_UIO1@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [sp]
	str	wzr, [sp, #8]
	ldr	w8, [x19]
	sub	w8, w8, #159
	cmp	w8, #3
	b.hs	LBB0_29
; %bb.26:
Lloh21:
	adrp	x9, l_switch.table.ctrl_set_channel@PAGE
Lloh22:
	add	x9, x9, l_switch.table.ctrl_set_channel@PAGEOFF
	ldr	w8, [x9, w8, sxtw #2]
	str	w8, [sp, #4]
	mov	x1, sp
	mov	x0, x20
	bl	_ctrl_uio_write
	cbnz	w0, LBB0_28
LBB0_27:
Lloh23:
	adrp	x8, _SCU_COMM_EXEC__A@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SCU_COMM_EXEC__A@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
Lloh26:
	adrp	x8, _SCU_COMM_EXEC_ACTIVE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _SCU_COMM_EXEC_ACTIVE@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	mov	x0, x21
	mov	w3, #0
	bl	_drxj_dap_write_reg16
	cbz	w0, LBB0_32
LBB0_28:
	mov	x22, x0
Lloh29:
	adrp	x0, l_.str@PAGE
Lloh30:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	bl	_pr_err
	b	LBB0_31
LBB0_29:
Lloh31:
	adrp	x8, _EINVAL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_30:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_31:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_32:
	cmp	w25, #3
	b.hs	LBB0_35
; %bb.33:
	mov	x0, x20
	mov	x1, x19
	mov	x2, #0
	bl	_set_qam_channel
	cbnz	w0, LBB0_28
LBB0_34:
	mov	w22, #0
	mov	w8, #1
	str	w8, [x23, #16]
	b	LBB0_31
LBB0_35:
	cmp	w24, #132
	b.ne	LBB0_38
; %bb.36:
	ldr	w8, [x19, #24]
Lloh33:
	adrp	x9, _DRX_MIRROR_AUTO@GOTPAGE
Lloh34:
	ldr	x9, [x9, _DRX_MIRROR_AUTO@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
Lloh36:
	adrp	x10, _DRX_MIRROR_NO@GOTPAGE
Lloh37:
	ldr	x10, [x10, _DRX_MIRROR_NO@GOTPAGEOFF]
Lloh38:
	ldr	w10, [x10]
	cmp	w8, w9
	csel	w8, w10, w8, eq
	str	w8, [x23, #20]
	mov	x0, x20
	bl	_set_vsb
	cbnz	w0, LBB0_28
; %bb.37:
	mov	x0, x20
	mov	x1, x19
	mov	x2, #0
	bl	_set_frequency
	cbnz	w0, LBB0_28
	b	LBB0_34
LBB0_38:
Lloh39:
	adrp	x8, _EIO@GOTPAGE
Lloh40:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_30
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DRX_STANDARD_NTSC,4,2          ; @DRX_STANDARD_NTSC
	.comm	_DRX_UIO1,4,2                   ; @DRX_UIO1
	.comm	_DRX_UIO_MODE_FIRMWARE_SAW,8,3  ; @DRX_UIO_MODE_FIRMWARE_SAW
	.comm	_DRXJ_QAM_SYMBOLRATE_MIN,8,3    ; @DRXJ_QAM_SYMBOLRATE_MIN
	.comm	_DRXJ_QAM_SYMBOLRATE_MAX,8,3    ; @DRXJ_QAM_SYMBOLRATE_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error %d\n"

	.comm	_SCU_COMM_EXEC__A,4,2           ; @SCU_COMM_EXEC__A
	.comm	_SCU_COMM_EXEC_ACTIVE,4,2       ; @SCU_COMM_EXEC_ACTIVE
	.comm	_DRX_MIRROR_AUTO,4,2            ; @DRX_MIRROR_AUTO
	.comm	_DRX_MIRROR_NO,4,2              ; @DRX_MIRROR_NO
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_ctrl_set_channel
	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.ctrl_set_channel
l_switch.table.ctrl_set_channel:
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.long	0                               ; 0x0

.subsections_via_symbols
