	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lgdt3306a_set_qam
_lgdt3306a_set_qam:                     ## @lgdt3306a_set_qam
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_dbg_info
	movq	%r14, %rdi
	movl	$8, %esi
	movl	$8, %edx
	callq	_lgdt3306a_write_reg
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_chkerr
	testq	%rax, %rax
	jne	LBB0_12
## %bb.1:
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	movl	$2, %esi
	callq	_lgdt3306a_read_reg
	movl	$243, %edx
	andl	-28(%rbp), %edx
	orl	$8, %edx
	movl	%edx, -28(%rbp)
	movq	%r14, %rdi
	movl	$2, %esi
	callq	_lgdt3306a_write_reg
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_chkerr
	testq	%rax, %rax
	jne	LBB0_12
## %bb.2:
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	movl	$9, %esi
	callq	_lgdt3306a_read_reg
	movl	$227, %edx
	andl	-28(%rbp), %edx
	movl	%edx, -28(%rbp)
	movq	%r14, %rdi
	movl	$9, %esi
	callq	_lgdt3306a_write_reg
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_chkerr
	testq	%rax, %rax
	jne	LBB0_12
## %bb.3:
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	movl	$9, %esi
	callq	_lgdt3306a_read_reg
	movl	$252, %eax
	andl	-28(%rbp), %eax
	movq	_forced_manual@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	sete	%cl
	movq	_QAM_AUTO@GOTPCREL(%rip), %rdx
	cmpl	%r15d, (%rdx)
	sete	%dl
	orb	%cl, %dl
	movzbl	%dl, %ecx
	leal	(%rcx,%rax), %edx
	incl	%edx
	movl	%edx, -28(%rbp)
	movq	%r14, %rdi
	movl	$9, %esi
	callq	_lgdt3306a_write_reg
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_chkerr
	testq	%rax, %rax
	jne	LBB0_12
## %bb.4:
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	movl	$4122, %esi                     ## imm = 0x101A
	callq	_lgdt3306a_read_reg
	movl	$248, %eax
	andl	-28(%rbp), %eax
	movq	_QAM_64@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpl	%r15d, (%rcx)
	setne	%dl
	leal	(%rax,%rdx,2), %edx
	addl	$2, %edx
	movl	%edx, -28(%rbp)
	movq	%r14, %rdi
	movl	$4122, %esi                     ## imm = 0x101A
	callq	_lgdt3306a_write_reg
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_chkerr
	testq	%rax, %rax
	jne	LBB0_12
## %bb.5:
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	movl	$13, %esi
	callq	_lgdt3306a_read_reg
	movzbl	-28(%rbp), %edx
	orl	$64, %edx
	movl	%edx, -28(%rbp)
	movq	%r14, %rdi
	movl	$13, %esi
	callq	_lgdt3306a_write_reg
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_chkerr
	testq	%rax, %rax
	jne	LBB0_12
## %bb.6:
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	movl	$36, %esi
	callq	_lgdt3306a_read_reg
	movl	$0, -28(%rbp)
	movq	%r14, %rdi
	movl	$36, %esi
	xorl	%edx, %edx
	callq	_lgdt3306a_write_reg
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_chkerr
	testq	%rax, %rax
	jne	LBB0_12
## %bb.7:
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	movl	$10, %esi
	callq	_lgdt3306a_read_reg
	movzbl	-28(%rbp), %edx
	orl	$2, %edx
	movl	%edx, -28(%rbp)
	movq	%r14, %rdi
	movl	$10, %esi
	callq	_lgdt3306a_write_reg
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_chkerr
	testq	%rax, %rax
	jne	LBB0_12
## %bb.8:
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	movl	$10313, %esi                    ## imm = 0x2849
	callq	_lgdt3306a_read_reg
	movl	$223, %edx
	andl	-28(%rbp), %edx
	movl	%edx, -28(%rbp)
	movq	%r14, %rdi
	movl	$10313, %esi                    ## imm = 0x2849
	callq	_lgdt3306a_write_reg
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_chkerr
	testq	%rax, %rax
	jne	LBB0_12
## %bb.9:
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	movl	$12331, %esi                    ## imm = 0x302B
	callq	_lgdt3306a_read_reg
	movl	-28(%rbp), %edx
	andl	$127, %edx
	movl	%edx, -28(%rbp)
	movq	%r14, %rdi
	movl	$12331, %esi                    ## imm = 0x302B
	callq	_lgdt3306a_write_reg
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_chkerr
	testq	%rax, %rax
	jne	LBB0_12
## %bb.10:
	movq	%r14, %rdi
	callq	_lgdt3306a_soft_reset
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_chkerr
	testq	%rax, %rax
	jne	LBB0_12
## %bb.11:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_dbg_info
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"modulation=%d\n"

	.comm	_forced_manual,8,3              ## @forced_manual
	.comm	_QAM_AUTO,4,2                   ## @QAM_AUTO
	.comm	_QAM_64,4,2                     ## @QAM_64
L_.str.1:                               ## @.str.1
	.asciz	"complete\n"

	.no_dead_strip	_lgdt3306a_set_qam
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lgdt3306a_set_qam
_lgdt3306a_set_qam:                     ; @lgdt3306a_set_qam
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
	str	x20, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dbg_info
	mov	x0, x19
	mov	w1, #8
	mov	w2, #8
	bl	_lgdt3306a_write_reg
	mov	x21, x0
	bl	_lg_chkerr
	cbnz	x0, LBB0_12
; %bb.1:
	add	x2, sp, #12
	mov	x0, x19
	mov	w1, #2
	bl	_lgdt3306a_read_reg
	ldr	w8, [sp, #12]
	mov	w9, #243
	and	w8, w8, w9
	orr	w2, w8, #0x8
	str	w2, [sp, #12]
	mov	x0, x19
	mov	w1, #2
	bl	_lgdt3306a_write_reg
	mov	x21, x0
	bl	_lg_chkerr
	cbnz	x0, LBB0_12
; %bb.2:
	add	x2, sp, #12
	mov	x0, x19
	mov	w1, #9
	bl	_lgdt3306a_read_reg
	ldr	w8, [sp, #12]
	mov	w9, #227
	and	w2, w8, w9
	str	w2, [sp, #12]
	mov	x0, x19
	mov	w1, #9
	bl	_lgdt3306a_write_reg
	mov	x21, x0
	bl	_lg_chkerr
	cbnz	x0, LBB0_12
; %bb.3:
	add	x2, sp, #12
	mov	x0, x19
	mov	w1, #9
	bl	_lgdt3306a_read_reg
	ldr	w8, [sp, #12]
	and	w8, w8, #0xfc
Lloh2:
	adrp	x9, _forced_manual@GOTPAGE
Lloh3:
	ldr	x9, [x9, _forced_manual@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
Lloh5:
	adrp	x10, _QAM_AUTO@GOTPAGE
Lloh6:
	ldr	x10, [x10, _QAM_AUTO@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	cmp	w10, w20
	ccmp	x9, #0, #4, ne
	mov	w9, #1
	cinc	w9, w9, eq
	orr	w2, w9, w8
	str	w2, [sp, #12]
	mov	x0, x19
	mov	w1, #9
	bl	_lgdt3306a_write_reg
	mov	x21, x0
	bl	_lg_chkerr
	cbnz	x0, LBB0_12
; %bb.4:
	add	x2, sp, #12
	mov	x0, x19
	mov	w1, #4122
	bl	_lgdt3306a_read_reg
	ldr	w8, [sp, #12]
	and	w8, w8, #0xf8
Lloh8:
	adrp	x9, _QAM_64@GOTPAGE
Lloh9:
	ldr	x9, [x9, _QAM_64@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	mov	w10, #4
	mov	w11, #2
	cmp	w9, w20
	csel	w9, w11, w10, eq
	orr	w2, w9, w8
	str	w2, [sp, #12]
	mov	x0, x19
	mov	w1, #4122
	bl	_lgdt3306a_write_reg
	mov	x21, x0
	bl	_lg_chkerr
	cbnz	x0, LBB0_12
; %bb.5:
	add	x2, sp, #12
	mov	x0, x19
	mov	w1, #13
	bl	_lgdt3306a_read_reg
	ldr	w8, [sp, #12]
	and	w8, w8, #0xff
	orr	w2, w8, #0x40
	str	w2, [sp, #12]
	mov	x0, x19
	mov	w1, #13
	bl	_lgdt3306a_write_reg
	mov	x21, x0
	bl	_lg_chkerr
	cbnz	x0, LBB0_12
; %bb.6:
	add	x2, sp, #12
	mov	x0, x19
	mov	w1, #36
	bl	_lgdt3306a_read_reg
	str	wzr, [sp, #12]
	mov	x0, x19
	mov	w1, #36
	mov	w2, #0
	bl	_lgdt3306a_write_reg
	mov	x21, x0
	bl	_lg_chkerr
	cbnz	x0, LBB0_12
; %bb.7:
	add	x2, sp, #12
	mov	x0, x19
	mov	w1, #10
	bl	_lgdt3306a_read_reg
	ldr	w8, [sp, #12]
	and	w8, w8, #0xff
	orr	w2, w8, #0x2
	str	w2, [sp, #12]
	mov	x0, x19
	mov	w1, #10
	bl	_lgdt3306a_write_reg
	mov	x21, x0
	bl	_lg_chkerr
	cbnz	x0, LBB0_12
; %bb.8:
	add	x2, sp, #12
	mov	x0, x19
	mov	w1, #10313
	bl	_lgdt3306a_read_reg
	ldr	w8, [sp, #12]
	mov	w9, #223
	and	w2, w8, w9
	str	w2, [sp, #12]
	mov	x0, x19
	mov	w1, #10313
	bl	_lgdt3306a_write_reg
	mov	x21, x0
	bl	_lg_chkerr
	cbnz	x0, LBB0_12
; %bb.9:
	add	x2, sp, #12
	mov	x0, x19
	mov	w1, #12331
	bl	_lgdt3306a_read_reg
	ldr	w8, [sp, #12]
	and	w2, w8, #0x7f
	str	w2, [sp, #12]
	mov	x0, x19
	mov	w1, #12331
	bl	_lgdt3306a_write_reg
	mov	x21, x0
	bl	_lg_chkerr
	cbnz	x0, LBB0_12
; %bb.10:
	mov	x0, x19
	bl	_lgdt3306a_soft_reset
	mov	x21, x0
	bl	_lg_chkerr
	cbnz	x0, LBB0_12
; %bb.11:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dbg_info
LBB0_12:
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"modulation=%d\n"

	.comm	_forced_manual,8,3              ; @forced_manual
	.comm	_QAM_AUTO,4,2                   ; @QAM_AUTO
	.comm	_QAM_64,4,2                     ; @QAM_64
l_.str.1:                               ; @.str.1
	.asciz	"complete\n"

	.no_dead_strip	_lgdt3306a_set_qam
.subsections_via_symbols
