	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fm_download_firmware
_fm_download_firmware:                  ## @fm_download_firmware
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	_FM_FW_DW_INPROGRESS@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	%rbx, %rsi
	callq	_set_bit
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rbx), %rdx
	leaq	-56(%rbp), %rdi
	movq	%r12, %rsi
	callq	_request_firmware
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	-56(%rbp), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_fmdbg
	movq	-56(%rbp), %rax
	movq	8(%rax), %r13
	movq	(%r13), %rdx
	movq	_FM_FW_FILE_HEADER_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_3
## %bb.4:
	movl	(%rax), %r14d
	leaq	L_.str.3(%rip), %rdi
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_fmdbg
	addl	$-8, %r14d
	testl	%r14d, %r14d
	jle	LBB0_5
## %bb.6:
	addq	$32, %r13
	xorl	%r15d, %r15d
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	16(%r13), %rax
	movl	(%rax), %edi
	callq	_mdelay
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	8(%r13), %rax
	leaq	96(%r13,%rax,4), %r13
	addq	$24, %rax
	subl	%eax, %r14d
	testl	%r14d, %r14d
	jle	LBB0_14
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %eax
	cmpl	$129, %eax
	je	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpl	$128, %eax
	jne	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	8(%r13), %r8
	movq	16(%r13), %rcx
	movq	$0, (%rsp)
	movq	%r12, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	callq	_fmc_send_cmd
	testl	%eax, %eax
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	incl	%r15d
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_1:
	leaq	L_.str(%rip), %rdi
	movq	%r12, %rsi
	callq	_fmerr
	jmp	LBB0_17
LBB0_3:
	leaq	L_.str.2(%rip), %rdi
	movq	%r12, %rsi
	callq	_fmerr
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	movl	%r15d, %ebx
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_5:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
LBB0_14:
	leaq	L_.str.4(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_fmdbg
LBB0_15:
	movq	_FM_FW_DW_INPROGRESS@GOTPCREL(%rip), %r14
LBB0_16:
	movq	-56(%rbp), %rdi
	callq	_release_firmware
	movl	(%r14), %edi
	movq	%r12, %rsi
	callq	_clear_bit
LBB0_17:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	%eax, %ebx
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_FM_FW_DW_INPROGRESS,4,2        ## @FM_FW_DW_INPROGRESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to read firmware(%s) content\n"

L_.str.1:                               ## @.str.1
	.asciz	"Firmware(%s) length : %zu bytes\n"

	.comm	_FM_FW_FILE_HEADER_MAGIC,8,3    ## @FM_FW_FILE_HEADER_MAGIC
L_.str.2:                               ## @.str.2
	.asciz	"%s not a legal TI firmware file\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.3:                               ## @.str.3
	.asciz	"FW(%s) magic number : 0x%x\n"

L_.str.4:                               ## @.str.4
	.asciz	"Firmware commands(%d) loaded to chip\n"

	.no_dead_strip	_fm_download_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fm_download_firmware
_fm_download_firmware:                  ; @fm_download_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _FM_FW_DW_INPROGRESS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _FM_FW_DW_INPROGRESS@GOTPAGEOFF]
	ldr	w0, [x22]
	mov	x1, x19
	bl	_set_bit
	ldr	x2, [x19, #8]
	add	x0, sp, #8
	mov	x1, x21
	bl	_request_firmware
	mov	x20, x0
	tbnz	w0, #31, LBB0_10
; %bb.1:
	ldr	x8, [sp, #8]
	ldr	w8, [x8]
	str	x8, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_fmdbg
	ldr	x9, [sp, #8]
	ldr	x24, [x9, #8]
	ldr	x8, [x24]
Lloh4:
	adrp	x10, _FM_FW_FILE_HEADER_MAGIC@GOTPAGE
Lloh5:
	ldr	x10, [x10, _FM_FW_FILE_HEADER_MAGIC@GOTPAGEOFF]
Lloh6:
	ldr	x10, [x10]
	cmp	x8, x10
	b.ne	LBB0_11
; %bb.2:
	ldr	w23, [x9]
	str	x8, [sp]
Lloh7:
	adrp	x0, l_.str.3@PAGE
Lloh8:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x21
	bl	_fmdbg
	sub	w23, w23, #8
	cmp	w23, #1
	b.lt	LBB0_12
; %bb.3:
	mov	w21, #0
	add	x24, x24, #32
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x24, #16]
	ldr	w0, [x8]
	bl	_mdelay
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x24, #8]
	add	x8, x8, #24
	add	x24, x24, x8, lsl #2
	sub	w23, w23, w8
	cmp	w23, #0
	b.le	LBB0_13
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	cmp	w8, #129
	b.eq	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w8, #128
	b.ne	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldp	x4, x3, [x24, #8]
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	mov	x5, #0
	mov	x6, #0
	bl	_fmc_send_cmd
	mov	x20, x0
	cbnz	w0, LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w21, w21, #1
	b	LBB0_5
LBB0_10:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_fmerr
	b	LBB0_15
LBB0_11:
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x21
	bl	_fmerr
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_14
LBB0_12:
	mov	w21, #0
LBB0_13:
Lloh16:
	adrp	x0, l_.str.4@PAGE
Lloh17:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x21
	bl	_fmdbg
LBB0_14:
	ldr	x0, [sp, #8]
	bl	_release_firmware
	ldr	w0, [x22]
	mov	x1, x19
	bl	_clear_bit
LBB0_15:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_FM_FW_DW_INPROGRESS,4,2        ; @FM_FW_DW_INPROGRESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to read firmware(%s) content\n"

l_.str.1:                               ; @.str.1
	.asciz	"Firmware(%s) length : %zu bytes\n"

	.comm	_FM_FW_FILE_HEADER_MAGIC,8,3    ; @FM_FW_FILE_HEADER_MAGIC
l_.str.2:                               ; @.str.2
	.asciz	"%s not a legal TI firmware file\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.3:                               ; @.str.3
	.asciz	"FW(%s) magic number : 0x%x\n"

l_.str.4:                               ; @.str.4
	.asciz	"Firmware commands(%d) loaded to chip\n"

	.no_dead_strip	_fm_download_firmware
.subsections_via_symbols
