	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stb0899_set_tone
_stb0899_set_tone:                      ## @stb0899_set_tone
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	(%rdi), %r15
	movq	%r15, %rdi
	movl	$100, %esi
	callq	_stb0899_wait_diseqc_txidle
	testq	%rax, %rax
	js	LBB0_1
## %bb.2:
	cmpl	$129, %ebx
	je	LBB0_5
## %bb.3:
	cmpl	$128, %ebx
	jne	LBB0_7
## %bb.4:
	movslq	(%r15), %rax
	imulq	$1999112051, %rax, %rax         ## imm = 0x77280773
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$50, %rax
	addl	%ecx, %eax
	imull	$26215, %eax, %r14d             ## imm = 0x6667
	addl	$131075, %r14d                  ## imm = 0x20003
	movl	%r14d, %eax
	shrl	$31, %eax
	sarl	$18, %r14d
	addl	%eax, %r14d
	movq	_STB0899_DISEQCOCFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$102, %edx
	callq	_stb0899_write_reg
	movq	_STB0899_ACRPRESC@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_stb0899_read_reg
	movl	%eax, %ebx
	movq	_ACRPRESC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	movl	$3, %edx
	callq	_STB0899_SETFIELD_VAL
	movl	(%r12), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_stb0899_write_reg
	movq	_STB0899_ACRDIV1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	jmp	LBB0_6
LBB0_1:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	jmp	LBB0_8
LBB0_5:
	movq	_STB0899_DISEQCOCFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$32, %edx
LBB0_6:
	callq	_stb0899_write_reg
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_8:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_STB0899_DISEQCOCFG,4,2         ## @STB0899_DISEQCOCFG
	.comm	_STB0899_ACRPRESC,4,2           ## @STB0899_ACRPRESC
	.comm	_ACRPRESC,4,2                   ## @ACRPRESC
	.comm	_STB0899_ACRDIV1,4,2            ## @STB0899_ACRDIV1
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_stb0899_set_tone
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stb0899_set_tone
_stb0899_set_tone:                      ; @stb0899_set_tone
	.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	x20, x1
	ldr	x19, [x0]
	mov	x0, x19
	mov	w1, #100
	bl	_stb0899_wait_diseqc_txidle
	tbnz	x0, #63, LBB0_4
; %bb.1:
	cmp	w20, #129
	b.eq	LBB0_5
; %bb.2:
	cmp	w20, #128
	b.ne	LBB0_7
; %bb.3:
	ldrsw	x8, [x19]
	mov	w9, #1907
	movk	w9, #30504, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #50
	add	w8, w8, w9
	add	w8, w8, #5
	mov	w9, #26215
	mul	w8, w8, w9
	asr	w9, w8, #18
	add	w20, w9, w8, lsr #31
Lloh0:
	adrp	x8, _STB0899_DISEQCOCFG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STB0899_DISEQCOCFG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #102
	bl	_stb0899_write_reg
Lloh3:
	adrp	x22, _STB0899_ACRPRESC@GOTPAGE
Lloh4:
	ldr	x22, [x22, _STB0899_ACRPRESC@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_stb0899_read_reg
	mov	x21, x0
Lloh5:
	adrp	x8, _ACRPRESC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ACRPRESC@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	x1, x21
	mov	w2, #3
	bl	_STB0899_SETFIELD_VAL
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x21
	bl	_stb0899_write_reg
Lloh8:
	adrp	x8, _STB0899_ACRDIV1@GOTPAGE
Lloh9:
	ldr	x8, [x8, _STB0899_ACRDIV1@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	b	LBB0_6
LBB0_4:
Lloh11:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
Lloh13:
	adrp	x8, _STB0899_DISEQCOCFG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _STB0899_DISEQCOCFG@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #32
LBB0_6:
	bl	_stb0899_write_reg
	mov	w0, #0
	b	LBB0_9
LBB0_7:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_STB0899_DISEQCOCFG,4,2         ; @STB0899_DISEQCOCFG
	.comm	_STB0899_ACRPRESC,4,2           ; @STB0899_ACRPRESC
	.comm	_ACRPRESC,4,2                   ; @ACRPRESC
	.comm	_STB0899_ACRDIV1,4,2            ; @STB0899_ACRDIV1
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_stb0899_set_tone
.subsections_via_symbols
