	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qtnf_topaz_fw_upload
_qtnf_topaz_fw_upload:                  ## @qtnf_topaz_fw_upload
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	movq	8(%rbx), %r15
	movq	_QTN_BDA_FW_LOAD_RDY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_QTN_FW_DL_TIMEOUT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_qtnf_poll_state
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_pr_err
LBB0_2:
	movl	$-1, %ebx
LBB0_3:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rsi
	callq	_pr_info
	leaq	-32(%rbp), %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_request_firmware
	testl	%eax, %eax
	js	LBB0_7
## %bb.5:
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movl	4(%rax), %esi
	movq	%rbx, %rdi
	callq	_qtnf_ep_fw_load
	movl	%eax, %ebx
	movq	-32(%rbp), %rdi
	callq	_release_firmware
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.6:
	leaq	L_.str.3(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_3
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_2
LBB0_8:
	xorl	%ebx, %ebx
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_QTN_BDA_FW_LOAD_RDY,4,2        ## @QTN_BDA_FW_LOAD_RDY
	.comm	_QTN_FW_DL_TIMEOUT_MS,4,2       ## @QTN_FW_DL_TIMEOUT_MS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: card is not ready\n"

L_.str.1:                               ## @.str.1
	.asciz	"starting firmware upload: %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"%s: request_firmware error %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"%s: FW upload error\n"

	.no_dead_strip	_qtnf_topaz_fw_upload
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qtnf_topaz_fw_upload
_qtnf_topaz_fw_upload:                  ; @qtnf_topaz_fw_upload
	.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
	mov	x19, x1
	mov	x20, x0
	ldp	x0, x21, [x0]
Lloh0:
	adrp	x8, _QTN_BDA_FW_LOAD_RDY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _QTN_BDA_FW_LOAD_RDY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _QTN_FW_DL_TIMEOUT_MS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _QTN_FW_DL_TIMEOUT_MS@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_qtnf_poll_state
	cbz	x0, LBB0_4
; %bb.1:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
LBB0_2:
	mov	x1, x19
	bl	_pr_err
	mov	w20, #-1
LBB0_3:
	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_4:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_pr_info
	add	x0, sp, #8
	mov	x1, x19
	mov	x2, x21
	bl	_request_firmware
                                        ; kill: def $w0 killed $w0 def $x0
	tbnz	w0, #31, LBB0_7
; %bb.5:
	ldr	x8, [sp, #8]
	ldp	w2, w1, [x8]
	mov	x0, x20
	bl	_qtnf_ep_fw_load
	mov	x20, x0
	ldr	x0, [sp, #8]
	bl	_release_firmware
	cbz	w20, LBB0_3
; %bb.6:
Lloh10:
	adrp	x0, l_.str.3@PAGE
Lloh11:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x19
	bl	_pr_err
	b	LBB0_3
LBB0_7:
	str	x0, [sp]
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_QTN_BDA_FW_LOAD_RDY,4,2        ; @QTN_BDA_FW_LOAD_RDY
	.comm	_QTN_FW_DL_TIMEOUT_MS,4,2       ; @QTN_FW_DL_TIMEOUT_MS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: card is not ready\n"

l_.str.1:                               ; @.str.1
	.asciz	"starting firmware upload: %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"%s: request_firmware error %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"%s: FW upload error\n"

	.no_dead_strip	_qtnf_topaz_fw_upload
.subsections_via_symbols
