	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_frequency
_set_frequency:                         ## @set_frequency
	.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
	imull	$62500, %esi, %eax              ## imm = 0xF424
	cltq
	imulq	$274877907, %rax, %rbx          ## imm = 0x10624DD3
	movq	%rbx, %rax
	shrq	$63, %rax
	sarq	$38, %rbx
	addl	%eax, %ebx
	movq	_TUNER_FREQ_MIN@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
	cmpl	%eax, %ebx
	jl	LBB0_2
## %bb.1:
	movq	_TUNER_FREQ_MAX@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
	cmpl	%eax, %ebx
	jle	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_4
LBB0_3:
	movl	%esi, %r15d
	movq	%rdi, %r14
	callq	_mutex_lock
	movq	_TUNE_FREQ_SELECT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %r12
	movq	%r14, %rdi
	movl	%ebx, %edx
	movq	%r12, %rcx
	callq	_send_set_req
	movq	_TAKE_REQUEST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	movq	%r12, %rcx
	callq	_send_set_req
	movl	%eax, %ebx
	movl	$250, %edi
	callq	_msleep
	movl	%r15d, 4(%r14)
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_4:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TUNER_FREQ_MIN,4,2             ## @TUNER_FREQ_MIN
	.comm	_TUNER_FREQ_MAX,4,2             ## @TUNER_FREQ_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_TUNE_FREQ_SELECT,4,2           ## @TUNE_FREQ_SELECT
	.comm	_TAKE_REQUEST,4,2               ## @TAKE_REQUEST
	.no_dead_strip	_set_frequency
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_frequency
_set_frequency:                         ; @set_frequency
	.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	w8, #62500
	mul	w8, w1, w8
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x8, w8, w9
	lsr	x10, x8, #63
	asr	x8, x8, #38
	add	w21, w8, w10
Lloh0:
	adrp	x8, _TUNER_FREQ_MIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TUNER_FREQ_MIN@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w9
	cmp	w21, w8
	b.lt	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _TUNER_FREQ_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TUNER_FREQ_MAX@GOTPAGEOFF]
Lloh5:
	ldrsw	x8, [x8]
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w9
	cmp	w21, w8
	b.le	LBB0_3
LBB0_2:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_4
LBB0_3:
	mov	x20, x1
	mov	x19, x0
	bl	_mutex_lock
Lloh9:
	adrp	x8, _TUNE_FREQ_SELECT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TUNE_FREQ_SELECT@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	x3, sp, #12
	mov	x0, x19
	mov	x2, x21
	bl	_send_set_req
Lloh12:
	adrp	x8, _TAKE_REQUEST@GOTPAGE
Lloh13:
	ldr	x8, [x8, _TAKE_REQUEST@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	add	x3, sp, #12
	mov	x0, x19
	mov	w2, #0
	bl	_send_set_req
	mov	x21, x0
	mov	w0, #250
	bl	_msleep
	str	w20, [x19, #4]
	mov	x0, x19
	bl	_mutex_unlock
LBB0_4:
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_TUNER_FREQ_MIN,4,2             ; @TUNER_FREQ_MIN
	.comm	_TUNER_FREQ_MAX,4,2             ; @TUNER_FREQ_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_TUNE_FREQ_SELECT,4,2           ; @TUNE_FREQ_SELECT
	.comm	_TAKE_REQUEST,4,2               ; @TAKE_REQUEST
	.no_dead_strip	_set_frequency
.subsections_via_symbols
