	.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
	movl	%esi, %r14d
	movq	%rdi, %r15
	callq	_mutex_lock
	movq	_TUNER_AUD_ANA_STD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r15), %edx
	leaq	-36(%rbp), %rcx
	movq	%r15, %rdi
	callq	_send_set_req
	imull	$62500, %r14d, %eax             ## imm = 0xF424
	cltq
	imulq	$274877907, %rax, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$38, %rdx
	addl	%eax, %edx
	movq	_TUNER_FREQ_MIN_FM@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, %edx
	jl	LBB0_2
## %bb.1:
	movq	_TUNER_FREQ_MAX_FM@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, %edx
	jle	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_TUNE_FREQ_SELECT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rcx
	movq	%r15, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_send_set_req
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movq	_TAKE_REQUEST@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-36(%rbp), %rcx
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_send_set_req
	movl	%eax, %ebx
	movq	_TASK_INTERRUPTIBLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_set_current_state
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	3(%rax), %edi
	testl	%eax, %eax
	cmovnsl	%eax, %edi
	sarl	$2, %edi
	callq	_schedule_timeout
	cmpl	$0, 8(%r15)
	jne	LBB0_7
## %bb.6:
	movl	(%r12), %esi
	leaq	-36(%rbp), %rbx
	movq	%r15, %rdi
	xorl	%edx, %edx
	movq	%rbx, %rcx
	callq	_send_set_req
	movq	_PLAY_SERVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TLG_TUNE_PLAY_SVC_START@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%rbx, %rcx
	callq	_send_set_req
	movl	%eax, %ebx
	movl	$1, 8(%r15)
LBB0_7:
	movl	%r14d, 12(%r15)
	jmp	LBB0_8
LBB0_4:
	movl	%eax, %ebx
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_TUNER_AUD_ANA_STD,4,2          ## @TUNER_AUD_ANA_STD
	.comm	_TUNER_FREQ_MIN_FM,4,2          ## @TUNER_FREQ_MIN_FM
	.comm	_TUNER_FREQ_MAX_FM,4,2          ## @TUNER_FREQ_MAX_FM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_TUNE_FREQ_SELECT,4,2           ## @TUNE_FREQ_SELECT
	.comm	_TAKE_REQUEST,4,2               ## @TAKE_REQUEST
	.comm	_TASK_INTERRUPTIBLE,4,2         ## @TASK_INTERRUPTIBLE
	.comm	_HZ,4,2                         ## @HZ
	.comm	_PLAY_SERVICE,4,2               ## @PLAY_SERVICE
	.comm	_TLG_TUNE_PLAY_SVC_START,4,2    ## @TLG_TUNE_PLAY_SVC_START
	.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	x20, x1
	mov	x19, x0
	bl	_mutex_lock
Lloh0:
	adrp	x8, _TUNER_AUD_ANA_STD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TUNER_AUD_ANA_STD@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w2, [x19, #4]
	add	x3, sp, #12
	mov	x0, x19
	bl	_send_set_req
	mov	w8, #62500
	mul	w8, w20, w8
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x8, w8, w9
	lsr	x10, x8, #63
	asr	x8, x8, #38
	add	w2, w8, w10
Lloh3:
	adrp	x8, _TUNER_FREQ_MIN_FM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TUNER_FREQ_MIN_FM@GOTPAGEOFF]
Lloh5:
	ldrsw	x8, [x8]
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w9
	cmp	w2, w8
	b.lt	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _TUNER_FREQ_MAX_FM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TUNER_FREQ_MAX_FM@GOTPAGEOFF]
Lloh8:
	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	w2, w8
	b.le	LBB0_4
LBB0_2:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_3:
	mov	x0, x19
	bl	_mutex_unlock
	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
LBB0_4:
Lloh12:
	adrp	x8, _TUNE_FREQ_SELECT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _TUNE_FREQ_SELECT@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	add	x3, sp, #12
	mov	x0, x19
	bl	_send_set_req
	tbnz	w0, #31, LBB0_8
; %bb.5:
Lloh15:
	adrp	x22, _TAKE_REQUEST@GOTPAGE
Lloh16:
	ldr	x22, [x22, _TAKE_REQUEST@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x3, sp, #12
	mov	x0, x19
	mov	w2, #0
	bl	_send_set_req
	mov	x21, x0
Lloh17:
	adrp	x8, _TASK_INTERRUPTIBLE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _TASK_INTERRUPTIBLE@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_set_current_state
Lloh20:
	adrp	x8, _HZ@GOTPAGE
Lloh21:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w0, w8, #2
	bl	_schedule_timeout
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_7
; %bb.6:
	ldr	w1, [x22]
	add	x3, sp, #12
	mov	x0, x19
	mov	w2, #0
	bl	_send_set_req
Lloh23:
	adrp	x8, _PLAY_SERVICE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _PLAY_SERVICE@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
Lloh26:
	adrp	x8, _TLG_TUNE_PLAY_SVC_START@GOTPAGE
Lloh27:
	ldr	x8, [x8, _TLG_TUNE_PLAY_SVC_START@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	add	x3, sp, #12
	mov	x0, x19
	bl	_send_set_req
	mov	x21, x0
	mov	w8, #1
	str	w8, [x19, #8]
LBB0_7:
	str	w20, [x19, #12]
	b	LBB0_3
LBB0_8:
	mov	x21, x0
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_TUNER_AUD_ANA_STD,4,2          ; @TUNER_AUD_ANA_STD
	.comm	_TUNER_FREQ_MIN_FM,4,2          ; @TUNER_FREQ_MIN_FM
	.comm	_TUNER_FREQ_MAX_FM,4,2          ; @TUNER_FREQ_MAX_FM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_TUNE_FREQ_SELECT,4,2           ; @TUNE_FREQ_SELECT
	.comm	_TAKE_REQUEST,4,2               ; @TAKE_REQUEST
	.comm	_TASK_INTERRUPTIBLE,4,2         ; @TASK_INTERRUPTIBLE
	.comm	_HZ,4,2                         ; @HZ
	.comm	_PLAY_SERVICE,4,2               ; @PLAY_SERVICE
	.comm	_TLG_TUNE_PLAY_SVC_START,4,2    ; @TLG_TUNE_PLAY_SVC_START
	.no_dead_strip	_set_frequency
.subsections_via_symbols
