	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lg2160_set_frontend
_lg2160_set_frontend:                   ## @lg2160_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
	movq	%rdi, %r15
	movq	32(%rdi), %r14
	movl	8(%rdi), %esi
	leaq	L_.str(%rip), %rdi
	callq	_lg_dbg
	movq	24(%r15), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%r15, %rdi
	callq	*%rax
	movl	%eax, %ebx
	movq	16(%r15), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	*%rax
LBB0_3:
	movl	%ebx, %edi
	callq	_lg_fail
	testq	%rax, %rax
	jne	LBB0_21
## %bb.4:
	movl	8(%r15), %eax
	movl	%eax, 8(%r14)
LBB0_5:
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_lg2160_agc_fix
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_fail
	testq	%rax, %rax
	jne	LBB0_21
## %bb.6:
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_lg2160_agc_polarity
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_fail
	testq	%rax, %rax
	jne	LBB0_21
## %bb.7:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_lg2160_tuner_pwr_save_polarity
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_fail
	testq	%rax, %rax
	jne	LBB0_21
## %bb.8:
	movq	%r14, %rdi
	callq	_lg216x_set_if
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_fail
	testq	%rax, %rax
	jne	LBB0_21
## %bb.9:
	movq	(%r14), %rax
	movl	4(%rax), %esi
	movq	%r14, %rdi
	callq	_lg2160_spectrum_polarity
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_fail
	testq	%rax, %rax
	jne	LBB0_21
## %bb.10:
	movq	%r14, %rdi
	callq	_lg216x_soft_reset
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_fail
	testq	%rax, %rax
	jne	LBB0_21
## %bb.11:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_lg2160_tuner_pwr_save
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_fail
	testq	%rax, %rax
	je	LBB0_12
LBB0_21:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	(%r14), %rax
	movl	(%rax), %eax
	cmpl	$128, %eax
	je	LBB0_15
## %bb.13:
	cmpl	$129, %eax
	jne	LBB0_17
## %bb.14:
	movq	%r14, %rdi
	callq	_lg2160_set_spi_clock
	jmp	LBB0_16
LBB0_15:
	movq	%r14, %rdi
	callq	_lg2161_set_output_interface
LBB0_16:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_fail
	testq	%rax, %rax
	jne	LBB0_21
LBB0_17:
	movl	4(%r15), %esi
	movq	%r14, %rdi
	callq	_lg216x_set_parade
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_fail
	testq	%rax, %rax
	jne	LBB0_21
## %bb.18:
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_lg216x_set_ensemble
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_fail
	testq	%rax, %rax
	jne	LBB0_21
## %bb.19:
	movq	%r14, %rdi
	callq	_lg216x_initialize
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_fail
	testq	%rax, %rax
	jne	LBB0_21
## %bb.20:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_lg216x_enable_fic
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_lg_fail
	movq	%r15, %rdi
	movq	%r15, %rsi
	callq	_lg216x_get_frontend
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(%d)\n"

	.no_dead_strip	_lg2160_set_frontend
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lg2160_set_frontend
_lg2160_set_frontend:                   ; @lg2160_set_frontend
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x0
	ldr	x20, [x0, #32]
	ldr	w1, [x0, #8]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_lg_dbg
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_5
; %bb.1:
	mov	x0, x19
	blr	x8
	mov	x21, x0
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_3
; %bb.2:
	mov	x0, x19
	mov	w1, #0
	blr	x8
LBB0_3:
	mov	x0, x21
	bl	_lg_fail
	cbnz	x0, LBB0_12
; %bb.4:
	ldr	w8, [x19, #8]
	str	w8, [x20, #8]
LBB0_5:
	mov	x0, x20
	mov	w1, #0
	mov	w2, #0
	bl	_lg2160_agc_fix
	mov	x21, x0
	bl	_lg_fail
	cbnz	x0, LBB0_12
; %bb.6:
	mov	x0, x20
	mov	w1, #0
	mov	w2, #0
	bl	_lg2160_agc_polarity
	mov	x21, x0
	bl	_lg_fail
	cbnz	x0, LBB0_12
; %bb.7:
	mov	x0, x20
	mov	w1, #1
	bl	_lg2160_tuner_pwr_save_polarity
	mov	x21, x0
	bl	_lg_fail
	cbnz	x0, LBB0_12
; %bb.8:
	mov	x0, x20
	bl	_lg216x_set_if
	mov	x21, x0
	bl	_lg_fail
	cbnz	x0, LBB0_12
; %bb.9:
	ldr	x8, [x20]
	ldr	w1, [x8, #4]
	mov	x0, x20
	bl	_lg2160_spectrum_polarity
	mov	x21, x0
	bl	_lg_fail
	cbnz	x0, LBB0_12
; %bb.10:
	mov	x0, x20
	bl	_lg216x_soft_reset
	mov	x21, x0
	bl	_lg_fail
	cbnz	x0, LBB0_12
; %bb.11:
	mov	x0, x20
	mov	w1, #0
	bl	_lg2160_tuner_pwr_save
	mov	x21, x0
	bl	_lg_fail
	cbz	x0, LBB0_13
LBB0_12:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_13:
	ldr	x8, [x20]
	ldr	w8, [x8]
	cmp	w8, #128
	b.eq	LBB0_16
; %bb.14:
	cmp	w8, #129
	b.ne	LBB0_18
; %bb.15:
	mov	x0, x20
	bl	_lg2160_set_spi_clock
	b	LBB0_17
LBB0_16:
	mov	x0, x20
	bl	_lg2161_set_output_interface
LBB0_17:
	mov	x21, x0
	bl	_lg_fail
	cbnz	x0, LBB0_12
LBB0_18:
	ldr	w1, [x19, #4]
	mov	x0, x20
	bl	_lg216x_set_parade
	mov	x21, x0
	bl	_lg_fail
	cbnz	x0, LBB0_12
; %bb.19:
	ldr	w1, [x19]
	mov	x0, x20
	bl	_lg216x_set_ensemble
	mov	x21, x0
	bl	_lg_fail
	cbnz	x0, LBB0_12
; %bb.20:
	mov	x0, x20
	bl	_lg216x_initialize
	mov	x21, x0
	bl	_lg_fail
	cbnz	x0, LBB0_12
; %bb.21:
	mov	x0, x20
	mov	w1, #1
	bl	_lg216x_enable_fic
	mov	x21, x0
	bl	_lg_fail
	mov	x0, x19
	mov	x1, x19
	bl	_lg216x_get_frontend
	b	LBB0_12
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%d)\n"

	.no_dead_strip	_lg2160_set_frontend
.subsections_via_symbols
