	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sp887x_setup_frontend_parameters
_sp887x_setup_frontend_parameters:      ## @sp887x_setup_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	24(%rdi), %r14
	movl	32(%rdi), %eax
	cmpl	$6000000, %eax                  ## imm = 0x5B8D80
	je	LBB0_4
## %bb.1:
	cmpl	$7000000, %eax                  ## imm = 0x6ACFC0
	je	LBB0_4
## %bb.2:
	cmpl	$8000000, %eax                  ## imm = 0x7A1200
	jne	LBB0_3
LBB0_4:
	leaq	32(%r12), %r15
	leaq	-40(%rbp), %rsi
	movq	%r15, %rdi
	callq	_configure_reg0xc05
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_13
## %bb.5:
	movq	%r14, %rdi
	callq	_sp887x_microcontroller_stop
	movq	16(%r12), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	movq	%r12, %rdi
	callq	*%rax
	movq	(%r12), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	*%rax
LBB0_8:
	movq	8(%r12), %rax
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:
	leaq	-36(%rbp), %rsi
	movq	%r12, %rdi
	callq	*%rax
	movq	(%r12), %rax
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	*%rax
	jmp	LBB0_12
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_11:
	movl	36(%r12), %eax
	movl	%eax, -36(%rbp)
LBB0_12:
	movq	%r14, %rdi
	movl	$512, %esi                      ## imm = 0x200
	callq	_sp887x_readreg
	movl	-36(%rbp), %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_sp887x_correct_offsets
	movl	32(%r12), %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	_sp887x_writereg
	movq	40(%r12), %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	_sp887x_writereg
	movl	-40(%rbp), %edx
	movq	%r14, %rdi
	movl	$3077, %esi                     ## imm = 0xC05
	callq	_sp887x_writereg
	movl	32(%r12), %eax
	cmpl	$7000000, %eax                  ## imm = 0x6ACFC0
	movl	$376, %ecx                      ## imm = 0x178
	movl	$352, %esi                      ## imm = 0x160
	cmovel	%ecx, %esi
	cmpl	$6000000, %eax                  ## imm = 0x5B8D80
	movl	$368, %edx                      ## imm = 0x170
	cmovnel	%esi, %edx
	movq	%r14, %rdi
	movl	$3860, %esi                     ## imm = 0xF14
	callq	_sp887x_writereg
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movl	$3861, %esi                     ## imm = 0xF15
	xorl	%edx, %edx
	callq	_sp887x_writereg
	movq	%r14, %rdi
	callq	_sp887x_microcontroller_start
LBB0_13:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_TRANSMISSION_MODE_2K,8,3       ## @TRANSMISSION_MODE_2K
	.no_dead_strip	_sp887x_setup_frontend_parameters
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sp887x_setup_frontend_parameters
_sp887x_setup_frontend_parameters:      ; @sp887x_setup_frontend_parameters
	.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	x21, x0
	ldr	w8, [x21, #32]!
	mov	w9, #36224
	movk	w9, #91, lsl #16
	cmp	w8, w9
	mov	w9, #53184
	movk	w9, #106, lsl #16
	ccmp	w8, w9, #4, ne
	mov	w9, #4608
	movk	w9, #122, lsl #16
	ccmp	w8, w9, #4, ne
	b.ne	LBB0_8
; %bb.1:
	mov	x20, x0
	ldr	x19, [x0, #24]
	add	x1, sp, #8
	mov	x0, x21
	bl	_configure_reg0xc05
	cbnz	w0, LBB0_11
; %bb.2:
	mov	x0, x19
	bl	_sp887x_microcontroller_stop
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_5
; %bb.3:
	mov	x0, x20
	blr	x8
	ldr	x8, [x20]
	cbz	x8, LBB0_5
; %bb.4:
	mov	x0, x20
	mov	w1, #0
	blr	x8
LBB0_5:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_9
; %bb.6:
	add	x1, sp, #12
	mov	x0, x20
	blr	x8
	ldr	x8, [x20]
	cbz	x8, LBB0_10
; %bb.7:
	mov	x0, x20
	mov	w1, #0
	blr	x8
	b	LBB0_10
LBB0_8:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_9:
	ldr	w8, [x20, #36]
	str	w8, [sp, #12]
LBB0_10:
	mov	x0, x19
	mov	w1, #512
	bl	_sp887x_readreg
	ldr	w2, [sp, #12]
	mov	x0, x19
	mov	x1, x21
	bl	_sp887x_correct_offsets
	ldr	w8, [x20, #32]
	mov	w21, #53184
	movk	w21, #106, lsl #16
	cmp	w8, w21
	cset	w9, eq
	mov	w22, #36224
	movk	w22, #91, lsl #16
	mov	w10, #2
	cmp	w8, w22
	csel	w2, w10, w9, eq
	mov	x0, x19
	mov	w1, #785
	bl	_sp887x_writereg
	ldr	x8, [x20, #40]
Lloh3:
	adrp	x9, _TRANSMISSION_MODE_2K@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TRANSMISSION_MODE_2K@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w2, ne
	mov	x0, x19
	mov	w1, #824
	bl	_sp887x_writereg
	ldr	w2, [sp, #8]
	mov	x0, x19
	mov	w1, #3077
	bl	_sp887x_writereg
	ldr	w8, [x20, #32]
	mov	w9, #352
	mov	w10, #376
	cmp	w8, w21
	csel	w9, w10, w9, eq
	mov	w10, #368
	cmp	w8, w22
	csel	w2, w10, w9, eq
	mov	x0, x19
	mov	w1, #3860
	bl	_sp887x_writereg
	mov	x0, x19
	mov	w1, #3861
	mov	w2, #0
	bl	_sp887x_writereg
	mov	x0, x19
	bl	_sp887x_microcontroller_start
	mov	w0, #0
LBB0_11:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_TRANSMISSION_MODE_2K,8,3       ; @TRANSMISSION_MODE_2K
	.no_dead_strip	_sp887x_setup_frontend_parameters
.subsections_via_symbols
