	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fm_rx_set_region               ## -- Begin function fm_rx_set_region
	.p2align	4, 0x90
_fm_rx_set_region:                      ## @fm_rx_set_region
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_FM_BAND_EUROPE_US@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	je	LBB0_3
## %bb.1:
	movq	_FM_BAND_JAPAN@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_fmerr
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_10
LBB0_3:
	cmpq	%rbx, 8(%r14)
	jne	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	callq	_fmerr
	xorl	%r15d, %r15d
	jmp	LBB0_10
LBB0_5:
	movq	%rbx, -32(%rbp)
	movq	_BAND_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_REG_WR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	$0, (%rsp)
	leaq	-32(%rbp), %rcx
	movq	%r14, %rdi
	movl	$8, %r8d
	xorl	%r9d, %r9d
	callq	_fmc_send_cmd
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_10
## %bb.6:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_fmc_update_region_info
	movq	(%r14), %rax
	movq	16(%r14), %rbx
	cmpq	%rbx, %rax
	jl	LBB0_8
## %bb.7:
	movq	24(%r14), %rbx
	cmpq	%rbx, %rax
	jle	LBB0_10
LBB0_8:
	testq	%rbx, %rbx
	je	LBB0_10
## %bb.9:
	leaq	L_.str.2(%rip), %rdi
	movq	%rbx, %rsi
	callq	_fmdbg
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_fm_rx_set_freq
	movl	%eax, %r15d
LBB0_10:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FM_BAND_EUROPE_US,8,3          ## @FM_BAND_EUROPE_US
	.comm	_FM_BAND_JAPAN,8,3              ## @FM_BAND_JAPAN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid band\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Requested band is already configured\n"

	.comm	_BAND_SET,4,2                   ## @BAND_SET
	.comm	_REG_WR,4,2                     ## @REG_WR
L_.str.2:                               ## @.str.2
	.asciz	"Current freq is not within band limit boundary,switching to %d KHz\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fm_rx_set_region               ; -- Begin function fm_rx_set_region
	.p2align	2
_fm_rx_set_region:                      ; @fm_rx_set_region
	.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
Lloh0:
	adrp	x8, _FM_BAND_EUROPE_US@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FM_BAND_EUROPE_US@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _FM_BAND_JAPAN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _FM_BAND_JAPAN@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x1
	ccmp	x9, x1, #4, ne
	b.ne	LBB0_3
; %bb.1:
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	cmp	x8, x1
	b.ne	LBB0_5
; %bb.2:
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_fmerr
	mov	w20, #0
	b	LBB0_4
LBB0_3:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_fmerr
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_4:
	mov	x0, x20
	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_5:
	str	x21, [sp, #8]
Lloh13:
	adrp	x8, _BAND_SET@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BAND_SET@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x8, _REG_WR@GOTPAGE
Lloh17:
	ldr	x8, [x8, _REG_WR@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	add	x3, sp, #8
	mov	x0, x19
	mov	w4, #8
	mov	x5, #0
	mov	x6, #0
	bl	_fmc_send_cmd
	mov	x20, x0
	tbnz	w0, #31, LBB0_4
; %bb.6:
	mov	x0, x19
	mov	x1, x21
	bl	_fmc_update_region_info
	ldr	x8, [x19]
	ldr	x21, [x19, #16]
	cmp	x8, x21
	b.lt	LBB0_8
; %bb.7:
	ldr	x21, [x19, #24]
	cmp	x8, x21
	b.le	LBB0_4
LBB0_8:
	cbz	x21, LBB0_4
; %bb.9:
Lloh19:
	adrp	x0, l_.str.2@PAGE
Lloh20:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x21
	bl	_fmdbg
	mov	x0, x19
	mov	x1, x21
	bl	_fm_rx_set_freq
	mov	x20, x0
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_FM_BAND_EUROPE_US,8,3          ; @FM_BAND_EUROPE_US
	.comm	_FM_BAND_JAPAN,8,3              ; @FM_BAND_JAPAN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid band\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Requested band is already configured\n"

	.comm	_BAND_SET,4,2                   ; @BAND_SET
	.comm	_REG_WR,4,2                     ; @REG_WR
l_.str.2:                               ; @.str.2
	.asciz	"Current freq is not within band limit boundary,switching to %d KHz\n"

.subsections_via_symbols
