	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fm_power_up
_fm_power_up:                           ## @fm_power_up
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$440, %rsp                      ## imm = 0x1B8
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	$0, -456(%rbp)
	movl	$0, -452(%rbp)
	movq	_FM_MODE_ENTRY_MAX@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jle	LBB0_1
## %bb.2:
	movq	%rsi, %r15
	movq	%rdi, %r14
	callq	_fmc_prepare
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	_FM_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -460(%rbp)
	movq	_FM_POWER_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_REG_WR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	$0, (%rsp)
	leaq	-460(%rbp), %rcx
	movq	%r14, %rdi
	movl	$4, %r8d
	xorl	%r9d, %r9d
	callq	_fmc_send_cmd
	testq	%rax, %rax
	jne	LBB0_13
## %bb.5:
	movl	$20, %edi
	callq	_msleep
	movq	_ASIC_ID_GET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_REG_RD@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	leaq	-464(%rbp), %rbx
	movq	%rbx, (%rsp)
	leaq	-456(%rbp), %r9
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	movl	$4, %r8d
	callq	_fmc_send_cmd
	testq	%rax, %rax
	jne	LBB0_13
## %bb.6:
	movq	_ASIC_VER_GET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	movq	%rbx, (%rsp)
	leaq	-452(%rbp), %r9
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	movl	$4, %r8d
	callq	_fmc_send_cmd
	testq	%rax, %rax
	jne	LBB0_13
## %bb.7:
	movl	-456(%rbp), %edi
	callq	_be16_to_cpu
	movl	%eax, %ebx
	movl	-452(%rbp), %edi
	callq	_be16_to_cpu
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fmdbg
	movq	_FM_FMC_FW_FILE_START@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movl	-456(%rbp), %edi
	callq	_be16_to_cpu
	movl	%eax, %ebx
	movl	-452(%rbp), %edi
	callq	_be16_to_cpu
	leaq	L_.str.3(%rip), %rsi
	leaq	-448(%rbp), %r13
	movq	%r13, %rdi
	movq	%r12, %rdx
	movl	%ebx, %ecx
	movl	%eax, %r8d
	callq	_sprintf
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_fm_download_firmware
	testl	%eax, %eax
	js	LBB0_12
## %bb.8:
	movq	_FM_MODE_RX@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	jne	LBB0_9
## %bb.10:
	movq	_FM_RX_FW_FILE_START@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_fmerr
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	callq	_fmerr
	jmp	LBB0_14
LBB0_9:
	movq	_FM_TX_FW_FILE_START@GOTPCREL(%rip), %rax
LBB0_11:
	movq	(%rax), %r15
	movl	-456(%rbp), %edi
	callq	_be16_to_cpu
	movl	%eax, %ebx
	movl	-452(%rbp), %edi
	callq	_be16_to_cpu
	leaq	L_.str.3(%rip), %rsi
	leaq	-448(%rbp), %r12
	movq	%r12, %rdi
	movq	%r15, %rdx
	movl	%ebx, %ecx
	movl	%eax, %r8d
	callq	_sprintf
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_fm_download_firmware
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_14
LBB0_12:
	leaq	L_.str.4(%rip), %rdi
	leaq	-448(%rbp), %rsi
	xorl	%eax, %eax
	callq	_fmdbg
LBB0_13:
	movq	%r14, %rdi
	callq	_fmc_release
	movl	%eax, %ebx
LBB0_14:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_16
## %bb.15:
	movl	%ebx, %eax
	addq	$440, %rsp                      ## imm = 0x1B8
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_FM_MODE_ENTRY_MAX,8,3          ## @FM_MODE_ENTRY_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid firmware download option\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Unable to prepare FM Common\n"

	.comm	_FM_ENABLE,4,2                  ## @FM_ENABLE
	.comm	_FM_POWER_MODE,4,2              ## @FM_POWER_MODE
	.comm	_REG_WR,4,2                     ## @REG_WR
	.comm	_ASIC_ID_GET,4,2                ## @ASIC_ID_GET
	.comm	_REG_RD,4,2                     ## @REG_RD
	.comm	_ASIC_VER_GET,4,2               ## @ASIC_VER_GET
L_.str.2:                               ## @.str.2
	.asciz	"ASIC ID: 0x%x , ASIC Version: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"%s_%x.%d.bts"

	.comm	_FM_FMC_FW_FILE_START,8,3       ## @FM_FMC_FW_FILE_START
L_.str.4:                               ## @.str.4
	.asciz	"Failed to download firmware file %s\n"

	.comm	_FM_MODE_RX,8,3                 ## @FM_MODE_RX
	.comm	_FM_RX_FW_FILE_START,8,3        ## @FM_RX_FW_FILE_START
	.comm	_FM_TX_FW_FILE_START,8,3        ## @FM_TX_FW_FILE_START
	.no_dead_strip	_fm_power_up
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fm_power_up
_fm_power_up:                           ; @fm_power_up
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	sub	sp, sp, #448
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	stp	wzr, wzr, [sp, #28]
Lloh3:
	adrp	x8, _FM_MODE_ENTRY_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FM_MODE_ENTRY_MAX@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x8, x1
	b.le	LBB0_9
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	bl	_fmc_prepare
	tbnz	w0, #31, LBB0_10
; %bb.2:
Lloh6:
	adrp	x8, _FM_ENABLE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FM_ENABLE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [sp, #36]
Lloh9:
	adrp	x8, _FM_POWER_MODE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _FM_POWER_MODE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x8, _REG_WR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _REG_WR@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	add	x3, sp, #36
	mov	x0, x19
	mov	w4, #4
	mov	x5, #0
	mov	x6, #0
	bl	_fmc_send_cmd
	cbnz	x0, LBB0_8
; %bb.3:
	mov	w0, #20
	bl	_msleep
Lloh15:
	adrp	x8, _ASIC_ID_GET@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ASIC_ID_GET@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x21, _REG_RD@GOTPAGE
Lloh19:
	ldr	x21, [x21, _REG_RD@GOTPAGEOFF]
	ldr	w2, [x21]
	add	x5, sp, #32
	add	x6, sp, #24
	mov	x0, x19
	mov	x3, #0
	mov	w4, #4
	bl	_fmc_send_cmd
	cbnz	x0, LBB0_8
; %bb.4:
Lloh20:
	adrp	x8, _ASIC_VER_GET@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ASIC_VER_GET@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	ldr	w2, [x21]
	add	x5, sp, #28
	add	x6, sp, #24
	mov	x0, x19
	mov	x3, #0
	mov	w4, #4
	bl	_fmc_send_cmd
	cbnz	x0, LBB0_8
; %bb.5:
	ldr	w0, [sp, #32]
	bl	_be16_to_cpu
	mov	x21, x0
	ldr	w0, [sp, #28]
	bl	_be16_to_cpu
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x21, x0, [sp]
Lloh23:
	adrp	x0, l_.str.2@PAGE
Lloh24:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_fmdbg
Lloh25:
	adrp	x8, _FM_FMC_FW_FILE_START@GOTPAGE
Lloh26:
	ldr	x8, [x8, _FM_FMC_FW_FILE_START@GOTPAGEOFF]
Lloh27:
	ldr	x21, [x8]
	ldr	w0, [sp, #32]
	bl	_be16_to_cpu
	mov	x22, x0
	ldr	w0, [sp, #28]
	bl	_be16_to_cpu
	mov	x4, x0
Lloh28:
	adrp	x1, l_.str.3@PAGE
Lloh29:
	add	x1, x1, l_.str.3@PAGEOFF
	add	x23, sp, #40
	add	x0, sp, #40
	mov	x2, x21
	mov	x3, x22
	bl	_sprintf
	add	x1, sp, #40
	mov	x0, x19
	bl	_fm_download_firmware
	tbnz	w0, #31, LBB0_7
; %bb.6:
Lloh30:
	adrp	x8, _FM_MODE_RX@GOTPAGE
Lloh31:
	ldr	x8, [x8, _FM_MODE_RX@GOTPAGEOFF]
Lloh32:
	ldr	x8, [x8]
Lloh33:
	adrp	x9, _FM_RX_FW_FILE_START@GOTPAGE
Lloh34:
	ldr	x9, [x9, _FM_RX_FW_FILE_START@GOTPAGEOFF]
Lloh35:
	adrp	x10, _FM_TX_FW_FILE_START@GOTPAGE
Lloh36:
	ldr	x10, [x10, _FM_TX_FW_FILE_START@GOTPAGEOFF]
	cmp	x8, x20
	csel	x8, x9, x10, eq
	ldr	x20, [x8]
	ldr	w0, [sp, #32]
	bl	_be16_to_cpu
	mov	x21, x0
	ldr	w0, [sp, #28]
	bl	_be16_to_cpu
	mov	x4, x0
Lloh37:
	adrp	x1, l_.str.3@PAGE
Lloh38:
	add	x1, x1, l_.str.3@PAGEOFF
	add	x0, sp, #40
	mov	x2, x20
	mov	x3, x21
	bl	_sprintf
	add	x1, sp, #40
	mov	x0, x19
	bl	_fm_download_firmware
	mov	x21, x0
	tbz	w0, #31, LBB0_11
LBB0_7:
	str	x23, [sp]
Lloh39:
	adrp	x0, l_.str.4@PAGE
Lloh40:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_fmdbg
LBB0_8:
	mov	x0, x19
	bl	_fmc_release
	mov	x21, x0
	b	LBB0_11
LBB0_9:
Lloh41:
	adrp	x0, l_.str@PAGE
Lloh42:
	add	x0, x0, l_.str@PAGEOFF
	bl	_fmerr
Lloh43:
	adrp	x8, _EINVAL@GOTPAGE
Lloh44:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh45:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_11
LBB0_10:
	mov	x21, x0
Lloh46:
	adrp	x0, l_.str.1@PAGE
Lloh47:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_fmerr
LBB0_11:
	ldur	x8, [x29, #-56]
Lloh48:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh49:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh50:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x21
	add	sp, sp, #448
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.comm	_FM_MODE_ENTRY_MAX,8,3          ; @FM_MODE_ENTRY_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid firmware download option\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Unable to prepare FM Common\n"

	.comm	_FM_ENABLE,4,2                  ; @FM_ENABLE
	.comm	_FM_POWER_MODE,4,2              ; @FM_POWER_MODE
	.comm	_REG_WR,4,2                     ; @REG_WR
	.comm	_ASIC_ID_GET,4,2                ; @ASIC_ID_GET
	.comm	_REG_RD,4,2                     ; @REG_RD
	.comm	_ASIC_VER_GET,4,2               ; @ASIC_VER_GET
l_.str.2:                               ; @.str.2
	.asciz	"ASIC ID: 0x%x , ASIC Version: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"%s_%x.%d.bts"

	.comm	_FM_FMC_FW_FILE_START,8,3       ; @FM_FMC_FW_FILE_START
l_.str.4:                               ; @.str.4
	.asciz	"Failed to download firmware file %s\n"

	.comm	_FM_MODE_RX,8,3                 ; @FM_MODE_RX
	.comm	_FM_RX_FW_FILE_START,8,3        ; @FM_RX_FW_FILE_START
	.comm	_FM_TX_FW_FILE_START,8,3        ; @FM_TX_FW_FILE_START
	.no_dead_strip	_fm_power_up
.subsections_via_symbols
