	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sp8870_set_frontend_parameters
_sp8870_set_frontend_parameters:        ## @sp8870_set_frontend_parameters
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	addq	$24, %rdi
	movq	16(%rbx), %r14
	leaq	-20(%rbp), %rsi
	callq	_configure_reg0xc05
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	movq	%r14, %rdi
	callq	_sp8870_microcontroller_stop
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	%rbx, %rdi
	callq	*%rax
	movq	(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	*%rax
LBB0_4:
	movq	%r14, %rdi
	movl	$793, %esi                      ## imm = 0x319
	movl	$10, %edx
	callq	_sp8870_writereg
	movq	%r14, %rdi
	movl	$794, %esi                      ## imm = 0x31A
	movl	$2731, %edx                     ## imm = 0xAAB
	callq	_sp8870_writereg
	movq	%r14, %rdi
	movl	$777, %esi                      ## imm = 0x309
	movl	$1024, %edx                     ## imm = 0x400
	callq	_sp8870_writereg
	movq	%r14, %rdi
	movl	$778, %esi                      ## imm = 0x30A
	xorl	%edx, %edx
	callq	_sp8870_writereg
	movl	24(%rbx), %eax
	xorl	%ecx, %ecx
	cmpl	$7000000, %eax                  ## imm = 0x6ACFC0
	sete	%cl
	cmpl	$6000000, %eax                  ## imm = 0x5B8D80
	movl	$2, %edx
	cmovnel	%ecx, %edx
	movq	%r14, %rdi
	movl	$785, %esi                      ## imm = 0x311
	callq	_sp8870_writereg
	movq	32(%rbx), %rax
	movq	_TRANSMISSION_MODE_2K@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	setne	%dl
	movq	%r14, %rdi
	movl	$824, %esi                      ## imm = 0x338
	callq	_sp8870_writereg
	movl	-20(%rbp), %edx
	movq	%r14, %rdi
	movl	$3077, %esi                     ## imm = 0xC05
	callq	_sp8870_writereg
	movq	%r14, %rdi
	movl	$512, %esi                      ## imm = 0x200
	callq	_sp8870_readreg
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	callq	_sp8870_microcontroller_start
	xorl	%eax, %eax
LBB0_6:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TRANSMISSION_MODE_2K,8,3       ## @TRANSMISSION_MODE_2K
	.no_dead_strip	_sp8870_set_frontend_parameters
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sp8870_set_frontend_parameters
_sp8870_set_frontend_parameters:        ; @sp8870_set_frontend_parameters
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x20, x0
	add	x0, x0, #24
	ldr	x19, [x20, #16]
	add	x1, sp, #12
	bl	_configure_reg0xc05
	cbnz	w0, LBB0_6
; %bb.1:
	mov	x0, x19
	bl	_sp8870_microcontroller_stop
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_4
; %bb.2:
	mov	x0, x20
	blr	x8
	ldr	x8, [x20]
	cbz	x8, LBB0_4
; %bb.3:
	mov	x0, x20
	mov	w1, #0
	blr	x8
LBB0_4:
	mov	x0, x19
	mov	w1, #793
	mov	w2, #10
	bl	_sp8870_writereg
	mov	x0, x19
	mov	w1, #794
	mov	w2, #2731
	bl	_sp8870_writereg
	mov	x0, x19
	mov	w1, #777
	mov	w2, #1024
	bl	_sp8870_writereg
	mov	x0, x19
	mov	w1, #778
	mov	w2, #0
	bl	_sp8870_writereg
	ldr	w8, [x20, #24]
	sub	w9, w8, #1708, lsl #12          ; =6995968
	cmp	w9, #4032
	cset	w9, eq
	sub	w8, w8, #1464, lsl #12          ; =5996544
	mov	w10, #2
	cmp	w8, #3456
	csel	w2, w10, w9, eq
	mov	x0, x19
	mov	w1, #785
	bl	_sp8870_writereg
	ldr	x8, [x20, #32]
Lloh0:
	adrp	x9, _TRANSMISSION_MODE_2K@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TRANSMISSION_MODE_2K@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w2, ne
	mov	x0, x19
	mov	w1, #824
	bl	_sp8870_writereg
	ldr	w2, [sp, #12]
	mov	x0, x19
	mov	w1, #3077
	bl	_sp8870_writereg
	mov	x0, x19
	mov	w1, #512
	bl	_sp8870_readreg
	cbnz	w0, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_sp8870_microcontroller_start
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_TRANSMISSION_MODE_2K,8,3       ; @TRANSMISSION_MODE_2K
	.no_dead_strip	_sp8870_set_frontend_parameters
.subsections_via_symbols
