	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fm_rx_set_volume               ## -- Begin function fm_rx_set_volume
	.p2align	4, 0x90
_fm_rx_set_volume:                      ## @fm_rx_set_volume
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	(%rdi), %rax
	movq	_FM_MODE_RX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.3:
	movl	%esi, %r14d
	movq	_FM_RX_VOLUME_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	cmpl	%esi, %edx
	jge	LBB0_5
## %bb.4:
	movq	_FM_RX_VOLUME_MIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	callq	_fmerr
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_1:
	movq	_EPERM@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	movq	%rdi, %rbx
	movq	_FM_RX_VOLUME_GAIN_STEP@GOTPCREL(%rip), %rax
	imull	(%rax), %r14d
	movl	%r14d, -20(%rbp)
	movq	_VOLUME_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_REG_WR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	$0, (%rsp)
	leaq	-20(%rbp), %rcx
	movl	$4, %r8d
	xorl	%r9d, %r9d
	callq	_fmc_send_cmd
	testl	%eax, %eax
	js	LBB0_7
## %bb.6:
	movl	%r14d, 8(%rbx)
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_FM_MODE_RX,8,3                 ## @FM_MODE_RX
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_FM_RX_VOLUME_MAX,4,2           ## @FM_RX_VOLUME_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Volume is not within(%d-%d) range\n"

	.comm	_FM_RX_VOLUME_MIN,4,2           ## @FM_RX_VOLUME_MIN
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_FM_RX_VOLUME_GAIN_STEP,4,2     ## @FM_RX_VOLUME_GAIN_STEP
	.comm	_VOLUME_SET,4,2                 ## @VOLUME_SET
	.comm	_REG_WR,4,2                     ## @REG_WR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fm_rx_set_volume               ; -- Begin function fm_rx_set_volume
	.p2align	2
_fm_rx_set_volume:                      ; @fm_rx_set_volume
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _FM_MODE_RX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FM_MODE_RX@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _FM_RX_VOLUME_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FM_RX_VOLUME_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	cmp	w2, w1
	b.ge	LBB0_6
; %bb.2:
Lloh6:
	adrp	x8, _FM_RX_VOLUME_MIN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FM_RX_VOLUME_MIN@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_fmerr
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh13:
	adrp	x8, _EPERM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_6:
	mov	x19, x0
Lloh15:
	adrp	x8, _FM_RX_VOLUME_GAIN_STEP@GOTPAGE
Lloh16:
	ldr	x8, [x8, _FM_RX_VOLUME_GAIN_STEP@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	mul	w20, w8, w1
	str	w20, [sp, #12]
Lloh18:
	adrp	x8, _VOLUME_SET@GOTPAGE
Lloh19:
	ldr	x8, [x8, _VOLUME_SET@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x8, _REG_WR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _REG_WR@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	add	x3, sp, #12
	mov	w4, #4
	mov	x5, #0
	mov	x6, #0
	bl	_fmc_send_cmd
	tbnz	w0, #31, LBB0_5
; %bb.7:
	str	w20, [x19, #8]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_FM_MODE_RX,8,3                 ; @FM_MODE_RX
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_FM_RX_VOLUME_MAX,4,2           ; @FM_RX_VOLUME_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Volume is not within(%d-%d) range\n"

	.comm	_FM_RX_VOLUME_MIN,4,2           ; @FM_RX_VOLUME_MIN
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_FM_RX_VOLUME_GAIN_STEP,4,2     ; @FM_RX_VOLUME_GAIN_STEP
	.comm	_VOLUME_SET,4,2                 ; @VOLUME_SET
	.comm	_REG_WR,4,2                     ; @REG_WR
.subsections_via_symbols
