	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fmc_set_mode                   ## -- Begin function fmc_set_mode
	.p2align	4, 0x90
_fmc_set_mode:                          ## @fmc_set_mode
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_FM_MODE_ENTRY_MAX@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jle	LBB0_3
## %bb.1:
	movl	%esi, %ebx
	movq	%rdi, %r14
	movl	(%rdi), %eax
	cmpl	%esi, %eax
	jne	LBB0_5
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_fmdbg
	jmp	LBB0_4
LBB0_3:
	leaq	L_.str(%rip), %rdi
	callq	_fmerr
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_4:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	leal	-128(%rbx), %ecx
	cmpl	$2, %ecx
	jae	LBB0_13
## %bb.6:
	cmpl	$130, %eax
	je	LBB0_9
## %bb.7:
	movq	%r14, %rdi
	callq	_fm_power_down
	testl	%eax, %eax
	js	LBB0_17
## %bb.8:
	movl	$30, %edi
	callq	_msleep
LBB0_9:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_fm_power_up
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_16
## %bb.10:
	movl	%ebx, (%r14)
	cmpl	$129, %ebx
	jne	LBB0_4
## %bb.11:
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_fmdbg
	movq	%r14, %rdi
	callq	_load_default_rx_configuration
	movl	%eax, %r15d
	testl	%eax, %eax
	jns	LBB0_4
## %bb.12:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_19
LBB0_13:
	xorl	%r15d, %r15d
	cmpl	$130, %ebx
	jne	LBB0_15
## %bb.14:
	movq	%r14, %rdi
	callq	_fm_power_down
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_18
LBB0_15:
	movl	%ebx, (%r14)
	jmp	LBB0_4
LBB0_16:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_19
LBB0_17:
	movl	%eax, %r15d
LBB0_18:
	leaq	L_.str.2(%rip), %rdi
LBB0_19:
	callq	_fmerr
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_FM_MODE_ENTRY_MAX,4,2          ## @FM_MODE_ENTRY_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid FM mode\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Already fm is in mode(%d)\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to set OFF mode\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to load firmware\n"

L_.str.4:                               ## @.str.4
	.asciz	"Loading default rx configuration..\n"

L_.str.5:                               ## @.str.5
	.asciz	"Failed to load default values\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fmc_set_mode                   ; -- Begin function fmc_set_mode
	.p2align	2
_fmc_set_mode:                          ; @fmc_set_mode
	.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_MODE_ENTRY_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FM_MODE_ENTRY_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.le	LBB0_3
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	ldr	w8, [x0]
	cmp	w8, w1
	b.ne	LBB0_5
; %bb.2:
	str	x20, [sp]
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_fmdbg
	mov	w21, #0
	b	LBB0_4
LBB0_3:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_fmerr
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w21, w8
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
LBB0_5:
	sub	w9, w20, #128
	cmp	w9, #2
	b.hs	LBB0_13
; %bb.6:
	cmp	w8, #130
	b.eq	LBB0_9
; %bb.7:
	mov	x0, x19
	bl	_fm_power_down
	tbnz	w0, #31, LBB0_18
; %bb.8:
	mov	w0, #30
	bl	_msleep
LBB0_9:
	mov	x0, x19
	mov	x1, x20
	bl	_fm_power_up
	mov	x21, x0
	tbnz	w0, #31, LBB0_17
; %bb.10:
	str	w20, [x19]
	cmp	w20, #129
	b.ne	LBB0_4
; %bb.11:
Lloh10:
	adrp	x0, l_.str.4@PAGE
Lloh11:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_fmdbg
	mov	x0, x19
	bl	_load_default_rx_configuration
	mov	x21, x0
	tbz	w0, #31, LBB0_4
; %bb.12:
Lloh12:
	adrp	x0, l_.str.5@PAGE
Lloh13:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_20
LBB0_13:
	cmp	w20, #130
	b.ne	LBB0_15
; %bb.14:
	mov	x0, x19
	bl	_fm_power_down
	mov	x21, x0
	tbz	w0, #31, LBB0_16
	b	LBB0_19
LBB0_15:
	mov	w21, #0
LBB0_16:
	str	w20, [x19]
	b	LBB0_4
LBB0_17:
Lloh14:
	adrp	x0, l_.str.3@PAGE
Lloh15:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_20
LBB0_18:
	mov	x21, x0
LBB0_19:
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_20:
	bl	_fmerr
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_FM_MODE_ENTRY_MAX,4,2          ; @FM_MODE_ENTRY_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid FM mode\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Already fm is in mode(%d)\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to set OFF mode\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to load firmware\n"

l_.str.4:                               ; @.str.4
	.asciz	"Loading default rx configuration..\n"

l_.str.5:                               ; @.str.5
	.asciz	"Failed to load default values\n"

.subsections_via_symbols
