	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fm_rx_set_af_switch            ## -- Begin function fm_rx_set_af_switch
	.p2align	4, 0x90
_fm_rx_set_af_switch:                   ## @fm_rx_set_af_switch
	.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	(%rdi), %rax
	movq	_FM_MODE_RX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.3:
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	_FM_RX_RDS_AF_SWITCH_MODE_ON@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	cmpq	%rsi, %rcx
	je	LBB0_6
## %bb.4:
	movq	_FM_RX_RDS_AF_SWITCH_MODE_OFF@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	je	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rdi
	callq	_fmerr
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_EPERM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_FM_LEV_EVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	%r14, %rcx
	jne	LBB0_8
## %bb.7:
	orl	16(%r15), %eax
	jmp	LBB0_9
LBB0_8:
	notl	%eax
	andl	16(%r15), %eax
LBB0_9:
	movl	%eax, 16(%r15)
	movl	%eax, -28(%rbp)
	movq	_INT_MASK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_REG_WR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	$0, (%rsp)
	xorl	%ebx, %ebx
	leaq	-28(%rbp), %rcx
	movq	%r15, %rdi
	movl	$4, %r8d
	xorl	%r9d, %r9d
	callq	_fmc_send_cmd
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	movq	%r14, 8(%r15)
	jmp	LBB0_12
LBB0_10:
	movl	%eax, %ebx
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_FM_MODE_RX,8,3                 ## @FM_MODE_RX
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_FM_RX_RDS_AF_SWITCH_MODE_ON,8,3 ## @FM_RX_RDS_AF_SWITCH_MODE_ON
	.comm	_FM_RX_RDS_AF_SWITCH_MODE_OFF,8,3 ## @FM_RX_RDS_AF_SWITCH_MODE_OFF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid af mode\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_FM_LEV_EVENT,4,2               ## @FM_LEV_EVENT
	.comm	_INT_MASK_SET,4,2               ## @INT_MASK_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_af_switch            ; -- Begin function fm_rx_set_af_switch
	.p2align	2
_fm_rx_set_af_switch:                   ; @fm_rx_set_af_switch
	.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_4
; %bb.1:
	mov	x19, x1
Lloh3:
	adrp	x8, _FM_RX_RDS_AF_SWITCH_MODE_ON@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FM_RX_RDS_AF_SWITCH_MODE_ON@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
Lloh6:
	adrp	x9, _FM_RX_RDS_AF_SWITCH_MODE_OFF@GOTPAGE
Lloh7:
	ldr	x9, [x9, _FM_RX_RDS_AF_SWITCH_MODE_OFF@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x1
	ccmp	x9, x1, #4, ne
	b.ne	LBB0_5
; %bb.2:
	mov	x20, x0
Lloh9:
	adrp	x9, _FM_LEV_EVENT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _FM_LEV_EVENT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	cmp	x8, x19
	b.ne	LBB0_8
; %bb.3:
	ldr	w8, [x20, #16]
	orr	w8, w8, w9
	b	LBB0_9
LBB0_4:
Lloh12:
	adrp	x8, _EPERM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_fmerr
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_8:
	ldr	w8, [x20, #16]
	bic	w8, w8, w9
LBB0_9:
	str	w8, [x20, #16]
	str	w8, [sp, #12]
Lloh18:
	adrp	x8, _INT_MASK_SET@GOTPAGE
Lloh19:
	ldr	x8, [x8, _INT_MASK_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	x0, x20
	mov	w4, #4
	mov	x5, #0
	mov	x6, #0
	bl	_fmc_send_cmd
	tbnz	w0, #31, LBB0_7
; %bb.10:
	mov	w0, #0
	str	x19, [x20, #8]
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_FM_MODE_RX,8,3                 ; @FM_MODE_RX
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_FM_RX_RDS_AF_SWITCH_MODE_ON,8,3 ; @FM_RX_RDS_AF_SWITCH_MODE_ON
	.comm	_FM_RX_RDS_AF_SWITCH_MODE_OFF,8,3 ; @FM_RX_RDS_AF_SWITCH_MODE_OFF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid af mode\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_FM_LEV_EVENT,4,2               ; @FM_LEV_EVENT
	.comm	_INT_MASK_SET,4,2               ; @INT_MASK_SET
	.comm	_REG_WR,4,2                     ; @REG_WR
.subsections_via_symbols
