	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cxd2880_set_frontend
_cxd2880_set_frontend:                  ## @cxd2880_set_frontend
	.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
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	movq	120(%rdi), %rax
	movq	128(%rdi), %r15
	movq	_FE_SCALE_NOT_AVAILABLE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 8(%rax)
	movq	$0, (%rax)
	movl	$1, 112(%rdi)
	movq	104(%rdi), %rax
	movq	%rcx, 8(%rax)
	movq	$0, (%rax)
	movl	$1, 96(%rdi)
	movq	88(%rdi), %rax
	movq	%rcx, 8(%rax)
	movq	$0, (%rax)
	movl	$1, 80(%rdi)
	movq	72(%rdi), %rax
	movq	%rcx, 8(%rax)
	movq	$0, (%rax)
	movl	$1, 64(%rdi)
	movq	56(%rdi), %rax
	movq	%rcx, 8(%rax)
	movq	$0, (%rax)
	movl	$1, 48(%rdi)
	movq	40(%rdi), %rax
	movq	%rcx, 8(%rax)
	movq	$0, (%rax)
	movl	$1, 32(%rdi)
	movl	(%rdi), %eax
	cmpl	$5999999, %eax                  ## imm = 0x5B8D7F
	jle	LBB0_3
## %bb.5:
	cmpl	$6000000, %eax                  ## imm = 0x5B8D80
	je	LBB0_9
## %bb.6:
	cmpl	$7000000, %eax                  ## imm = 0x6ACFC0
	je	LBB0_10
## %bb.7:
	cmpl	$8000000, %eax                  ## imm = 0x7A1200
	jne	LBB0_12
## %bb.8:
	movq	_CXD2880_DTV_BW_8_MHZ@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_12
LBB0_3:
	cmpl	$1712000, %eax                  ## imm = 0x1A1F80
	je	LBB0_4
## %bb.11:
	cmpl	$5000000, %eax                  ## imm = 0x4C4B40
	jne	LBB0_12
## %bb.13:
	movq	_CXD2880_DTV_BW_5_MHZ@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_9:
	movq	_CXD2880_DTV_BW_6_MHZ@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_10:
	movq	_CXD2880_DTV_BW_7_MHZ@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_4:
	movq	_CXD2880_DTV_BW_1_7_MHZ@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %r14d
	movq	$0, 48(%r15)
	movl	8(%rbx), %esi
	movl	16(%rbx), %edx
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_pr_info
	movl	(%r15), %edi
	callq	_mutex_lock
	movq	8(%rbx), %rax
	movq	_SYS_DVBT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.15:
	movq	_CXD2880_DTV_SYS_DVBT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	32(%r15), %rdi
	movl	%eax, 32(%r15)
	movslq	16(%rbx), %rax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
	leaq	36(%r15), %rsi
	movl	%eax, 36(%r15)
	movl	%r14d, 40(%r15)
	movq	_CXD2880_DVBT_PROFILE_HP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%r15)
	callq	_cxd2880_dvbt_tune
	jmp	LBB0_18
LBB0_16:
	movq	_SYS_DVBT2@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_20
## %bb.17:
	movq	_CXD2880_DTV_SYS_DVBT2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	32(%r15), %rdi
	movl	%eax, 32(%r15)
	movslq	16(%rbx), %rax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
	leaq	8(%r15), %rsi
	movl	%eax, 8(%r15)
	movl	%r14d, 12(%r15)
	movq	24(%rbx), %rax
	movq	%rax, 24(%r15)
	movq	_CXD2880_DVBT2_PROFILE_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r15)
	callq	_cxd2880_dvbt2_tune
LBB0_18:
	movl	%eax, %ebx
	movl	(%r15), %edi
	callq	_mutex_unlock
	leaq	L_.str.3(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_pr_info
	jmp	LBB0_19
LBB0_20:
	leaq	L_.str.2(%rip), %rdi
	callq	_pr_err
	movl	(%r15), %edi
	callq	_mutex_unlock
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CXD2880_DTV_BW_1_7_MHZ,4,2     ## @CXD2880_DTV_BW_1_7_MHZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid arg\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_FE_SCALE_NOT_AVAILABLE,8,3     ## @FE_SCALE_NOT_AVAILABLE
	.comm	_CXD2880_DTV_BW_5_MHZ,4,2       ## @CXD2880_DTV_BW_5_MHZ
	.comm	_CXD2880_DTV_BW_6_MHZ,4,2       ## @CXD2880_DTV_BW_6_MHZ
	.comm	_CXD2880_DTV_BW_7_MHZ,4,2       ## @CXD2880_DTV_BW_7_MHZ
	.comm	_CXD2880_DTV_BW_8_MHZ,4,2       ## @CXD2880_DTV_BW_8_MHZ
L_.str.1:                               ## @.str.1
	.asciz	"sys:%d freq:%d bw:%d\n"

	.comm	_SYS_DVBT,8,3                   ## @SYS_DVBT
	.comm	_CXD2880_DTV_SYS_DVBT,4,2       ## @CXD2880_DTV_SYS_DVBT
	.comm	_CXD2880_DVBT_PROFILE_HP,4,2    ## @CXD2880_DVBT_PROFILE_HP
	.comm	_SYS_DVBT2,8,3                  ## @SYS_DVBT2
	.comm	_CXD2880_DTV_SYS_DVBT2,4,2      ## @CXD2880_DTV_SYS_DVBT2
	.comm	_CXD2880_DVBT2_PROFILE_BASE,4,2 ## @CXD2880_DVBT2_PROFILE_BASE
L_.str.2:                               ## @.str.2
	.asciz	"invalid system\n"

L_.str.3:                               ## @.str.3
	.asciz	"tune result %d\n"

	.no_dead_strip	_cxd2880_set_frontend
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cxd2880_set_frontend
_cxd2880_set_frontend:                  ; @cxd2880_set_frontend
	.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
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _FE_SCALE_NOT_AVAILABLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FE_SCALE_NOT_AVAILABLE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldp	x9, x20, [x0, #120]
	stp	xzr, x8, [x9]
	mov	w9, #1
	str	w9, [x0, #112]
	ldr	x10, [x0, #104]
	stp	xzr, x8, [x10]
	str	w9, [x0, #96]
	ldr	x10, [x0, #88]
	stp	xzr, x8, [x10]
	str	w9, [x0, #80]
	ldr	x10, [x0, #72]
	stp	xzr, x8, [x10]
	str	w9, [x0, #64]
	ldr	x10, [x0, #56]
	stp	xzr, x8, [x10]
	str	w9, [x0, #48]
	ldr	x10, [x0, #40]
	stp	xzr, x8, [x10]
	str	w9, [x0, #32]
	mov	w9, #36223
	movk	w9, #91, lsl #16
	ldr	w8, [x0]
	cmp	w8, w9
	b.le	LBB0_7
; %bb.2:
	mov	w9, #36224
	movk	w9, #91, lsl #16
	cmp	w8, w9
	b.eq	LBB0_10
; %bb.3:
	mov	w9, #53184
	movk	w9, #106, lsl #16
	cmp	w8, w9
	b.eq	LBB0_11
; %bb.4:
	mov	w9, #4608
	movk	w9, #122, lsl #16
	cmp	w8, w9
	b.ne	LBB0_19
; %bb.5:
Lloh3:
	adrp	x8, _CXD2880_DTV_BW_8_MHZ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CXD2880_DTV_BW_8_MHZ@GOTPAGEOFF]
	b	LBB0_13
LBB0_6:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_19
LBB0_7:
	mov	w9, #8064
	movk	w9, #26, lsl #16
	cmp	w8, w9
	b.eq	LBB0_12
; %bb.8:
	mov	w9, #19264
	movk	w9, #76, lsl #16
	cmp	w8, w9
	b.ne	LBB0_19
; %bb.9:
Lloh7:
	adrp	x8, _CXD2880_DTV_BW_5_MHZ@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CXD2880_DTV_BW_5_MHZ@GOTPAGEOFF]
	b	LBB0_13
LBB0_10:
Lloh9:
	adrp	x8, _CXD2880_DTV_BW_6_MHZ@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CXD2880_DTV_BW_6_MHZ@GOTPAGEOFF]
	b	LBB0_13
LBB0_11:
Lloh11:
	adrp	x8, _CXD2880_DTV_BW_7_MHZ@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CXD2880_DTV_BW_7_MHZ@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
Lloh13:
	adrp	x8, _CXD2880_DTV_BW_1_7_MHZ@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CXD2880_DTV_BW_1_7_MHZ@GOTPAGEOFF]
LBB0_13:
	ldr	w21, [x8]
	str	xzr, [x20, #48]
	ldr	w1, [x19, #8]
	ldr	w8, [x19, #16]
	stp	x8, x21, [sp]
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_info
	ldr	w0, [x20]
	bl	_mutex_lock
	ldr	x8, [x19, #8]
Lloh17:
	adrp	x9, _SYS_DVBT@GOTPAGE
Lloh18:
	ldr	x9, [x9, _SYS_DVBT@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.14:
Lloh20:
	adrp	x8, _CXD2880_DTV_SYS_DVBT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _CXD2880_DTV_SYS_DVBT@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	ldrsw	x9, [x19, #16]
	mov	w10, #19923
	movk	w10, #4194, lsl #16
	mul	x9, x9, x10
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w9, w9, w10
	mov	x1, x20
	str	w9, [x1, #36]!
	mov	x0, x1
	str	w8, [x0, #-4]!
Lloh23:
	adrp	x8, _CXD2880_DVBT_PROFILE_HP@GOTPAGE
Lloh24:
	ldr	x8, [x8, _CXD2880_DVBT_PROFILE_HP@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	stp	w21, w8, [x1, #4]
	bl	_cxd2880_dvbt_tune
	b	LBB0_17
LBB0_15:
Lloh26:
	adrp	x9, _SYS_DVBT2@GOTPAGE
Lloh27:
	ldr	x9, [x9, _SYS_DVBT2@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_18
; %bb.16:
Lloh29:
	adrp	x8, _CXD2880_DTV_SYS_DVBT2@GOTPAGE
Lloh30:
	ldr	x8, [x8, _CXD2880_DTV_SYS_DVBT2@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	ldrsw	x9, [x19, #16]
	mov	w10, #19923
	movk	w10, #4194, lsl #16
	mul	x9, x9, x10
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w9, w9, w10
	mov	x1, x20
	str	w9, [x1, #8]!
	mov	x0, x1
	str	w8, [x0, #24]!
	ldr	x8, [x19, #24]
	str	x8, [x1, #16]
Lloh32:
	adrp	x8, _CXD2880_DVBT2_PROFILE_BASE@GOTPAGE
Lloh33:
	ldr	x8, [x8, _CXD2880_DVBT2_PROFILE_BASE@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	stp	w21, w8, [x1, #4]
	bl	_cxd2880_dvbt2_tune
LBB0_17:
	mov	x19, x0
	ldr	w0, [x20]
	bl	_mutex_unlock
Lloh35:
	adrp	x0, l_.str.3@PAGE
Lloh36:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x19
	bl	_pr_info
	b	LBB0_20
LBB0_18:
Lloh37:
	adrp	x0, l_.str.2@PAGE
Lloh38:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_err
	ldr	w0, [x20]
	bl	_mutex_unlock
LBB0_19:
Lloh39:
	adrp	x8, _EINVAL@GOTPAGE
Lloh40:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_20:
	mov	x0, x19
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_CXD2880_DTV_BW_1_7_MHZ,4,2     ; @CXD2880_DTV_BW_1_7_MHZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid arg\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_FE_SCALE_NOT_AVAILABLE,8,3     ; @FE_SCALE_NOT_AVAILABLE
	.comm	_CXD2880_DTV_BW_5_MHZ,4,2       ; @CXD2880_DTV_BW_5_MHZ
	.comm	_CXD2880_DTV_BW_6_MHZ,4,2       ; @CXD2880_DTV_BW_6_MHZ
	.comm	_CXD2880_DTV_BW_7_MHZ,4,2       ; @CXD2880_DTV_BW_7_MHZ
	.comm	_CXD2880_DTV_BW_8_MHZ,4,2       ; @CXD2880_DTV_BW_8_MHZ
l_.str.1:                               ; @.str.1
	.asciz	"sys:%d freq:%d bw:%d\n"

	.comm	_SYS_DVBT,8,3                   ; @SYS_DVBT
	.comm	_CXD2880_DTV_SYS_DVBT,4,2       ; @CXD2880_DTV_SYS_DVBT
	.comm	_CXD2880_DVBT_PROFILE_HP,4,2    ; @CXD2880_DVBT_PROFILE_HP
	.comm	_SYS_DVBT2,8,3                  ; @SYS_DVBT2
	.comm	_CXD2880_DTV_SYS_DVBT2,4,2      ; @CXD2880_DTV_SYS_DVBT2
	.comm	_CXD2880_DVBT2_PROFILE_BASE,4,2 ; @CXD2880_DVBT2_PROFILE_BASE
l_.str.2:                               ; @.str.2
	.asciz	"invalid system\n"

l_.str.3:                               ; @.str.3
	.asciz	"tune result %d\n"

	.no_dead_strip	_cxd2880_set_frontend
.subsections_via_symbols
