	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stv090x_set_srate
_stv090x_set_srate:                     ## @stv090x_set_srate
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %eax
	movq	%rdi, %r14
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	cmpl	$6000001, %esi                  ## imm = 0x5B8D81
	setl	%cl
	setge	%dl
	cmpl	$60000001, %esi                 ## imm = 0x3938701
	leal	6(%rcx,%rcx,2), %esi
	movl	$4, %ecx
	cmovll	%esi, %ecx
	leal	7(%rdx,%rdx,2), %esi
	movl	$12, %edx
	cmovll	%esi, %edx
	movq	(%rdi), %rsi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movl	(%rsi), %esi
	movl	%edx, %ecx
	sarl	%cl, %esi
	cltd
	idivl	%esi
	movl	%eax, %ebx
	movq	_SFRINIT1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	shrl	$8, %edx
	andl	$127, %edx
	callq	_STV090x_WRITE_DEMOD
	testq	%rax, %rax
	js	LBB0_2
## %bb.1:
	movq	_SFRINIT0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%bl, %edx
	movq	%r14, %rdi
	callq	_STV090x_WRITE_DEMOD
	movq	%rax, %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jns	LBB0_3
LBB0_2:
	movq	_FE_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rdx
	movl	$1, %esi
	callq	_dprintk
	movl	$-1, %eax
LBB0_3:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SFRINIT1,4,2                   ## @SFRINIT1
	.comm	_SFRINIT0,4,2                   ## @SFRINIT0
	.comm	_FE_ERROR,4,2                   ## @FE_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"I/O error"

	.no_dead_strip	_stv090x_set_srate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stv090x_set_srate
_stv090x_set_srate:                     ; @stv090x_set_srate
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	mov	w8, #36224
	movk	w8, #91, lsl #16
	mov	w9, #9
	mov	w10, #6
	cmp	w1, w8
	csel	w8, w10, w9, gt
	mov	w9, #7
	mov	w10, #10
	csel	w9, w10, w9, gt
	mov	w10, #34560
	movk	w10, #915, lsl #16
	mov	w11, #4
	cmp	w1, w10
	csel	w8, w11, w8, gt
	mov	w10, #12
	csel	w9, w10, w9, gt
	lsl	w8, w1, w8
	ldr	x10, [x0]
	ldr	w10, [x10]
	asr	w9, w10, w9
	sdiv	w20, w8, w9
Lloh0:
	adrp	x8, _SFRINIT1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SFRINIT1@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ubfx	w2, w20, #8, #7
	bl	_STV090x_WRITE_DEMOD
	tbnz	x0, #63, LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _SFRINIT0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SFRINIT0@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	and	w2, w20, #0xff
	mov	x0, x19
	bl	_STV090x_WRITE_DEMOD
	tbnz	x0, #63, LBB0_3
; %bb.2:
	mov	w0, #0
	b	LBB0_4
LBB0_3:
Lloh6:
	adrp	x8, _FE_ERROR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FE_ERROR@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x2, l_.str@PAGE
Lloh10:
	add	x2, x2, l_.str@PAGEOFF
	mov	w1, #1
	bl	_dprintk
	mov	w0, #-1
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_SFRINIT1,4,2                   ; @SFRINIT1
	.comm	_SFRINIT0,4,2                   ; @SFRINIT0
	.comm	_FE_ERROR,4,2                   ; @FE_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"I/O error"

	.no_dead_strip	_stv090x_set_srate
.subsections_via_symbols
