	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath10k_download_and_run_otp
_ath10k_download_and_run_otp:           ## @ath10k_download_and_run_otp
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	16(%rdi), %r15d
	movl	20(%rdi), %r12d
	movq	8(%rdi), %rax
	movl	12(%rax), %edx
	movl	16(%rax), %esi
	callq	_ath10k_download_board_data
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rsi
LBB0_2:
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_ath10k_err
	jmp	LBB0_15
LBB0_3:
	movq	8(%rbx), %rax
	movl	4(%rax), %r8d
	movl	8(%rax), %edx
	testl	%edx, %edx
	je	LBB0_6
## %bb.4:
	testl	%r8d, %r8d
	je	LBB0_5
## %bb.7:
	movq	_ATH10K_DBG_BOOT@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_ath10k_dbg
	movq	8(%rbx), %rax
	movl	4(%rax), %ecx
	movl	8(%rax), %edx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_ath10k_bmi_fast_download
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %r14d
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_2
LBB0_5:
	xorl	%r8d, %r8d
LBB0_6:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r8d, %ecx
	callq	_ath10k_warn
	xorl	%r14d, %r14d
LBB0_15:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	(%rbx), %rax
	movq	_ATH10K_PRE_CAL_MODE_DT@GOTPCREL(%rip), %rcx
	movq	_ATH10K_PRE_CAL_MODE_FILE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	movq	_BMI_PARAM_FLASH_SECTION_ALL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmovel	%edx, %r12d
	cmpq	(%rcx), %rax
	cmovel	%edx, %r12d
	leaq	-44(%rbp), %rcx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%r12d, %edx
	callq	_ath10k_bmi_execute
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %r14d
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_2
LBB0_11:
	movl	(%r13), %esi
	movl	-44(%rbp), %ecx
	leaq	L_.str.5(%rip), %rdx
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_ath10k_dbg
	movq	_skip_otp@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_15
## %bb.12:
	movq	_ATH10K_FW_FEATURE_IGNORE_OTP_RESULT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%rbx), %rax
	movl	(%rax), %esi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_15
## %bb.13:
	movl	-44(%rbp), %edx
	testl	%edx, %edx
	je	LBB0_15
## %bb.14:
	leaq	L_.str.6(%rip), %rsi
	movq	%rbx, %rdi
	callq	_ath10k_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to download board data: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Not running otp, calibration will be incorrect (otp-data %pK otp_len %zd)!\n"

	.comm	_ATH10K_DBG_BOOT,4,2            ## @ATH10K_DBG_BOOT
L_.str.2:                               ## @.str.2
	.asciz	"boot upload otp to 0x%x len %zd\n"

L_.str.3:                               ## @.str.3
	.asciz	"could not write otp (%d)\n"

	.comm	_ATH10K_PRE_CAL_MODE_DT,8,3     ## @ATH10K_PRE_CAL_MODE_DT
	.comm	_ATH10K_PRE_CAL_MODE_FILE,8,3   ## @ATH10K_PRE_CAL_MODE_FILE
	.comm	_BMI_PARAM_FLASH_SECTION_ALL,4,2 ## @BMI_PARAM_FLASH_SECTION_ALL
L_.str.4:                               ## @.str.4
	.asciz	"could not execute otp (%d)\n"

L_.str.5:                               ## @.str.5
	.asciz	"boot otp execute result %d\n"

	.comm	_skip_otp,8,3                   ## @skip_otp
	.comm	_ATH10K_FW_FEATURE_IGNORE_OTP_RESULT,4,2 ## @ATH10K_FW_FEATURE_IGNORE_OTP_RESULT
L_.str.6:                               ## @.str.6
	.asciz	"otp calibration failed: %d"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_ath10k_download_and_run_otp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath10k_download_and_run_otp
_ath10k_download_and_run_otp:           ; @ath10k_download_and_run_otp
	.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	x19, x0
	ldp	w20, w22, [x0, #16]
	ldr	x8, [x0, #8]
	ldp	w2, w1, [x8, #12]
	bl	_ath10k_download_board_data
	cbz	w0, LBB0_3
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
LBB0_2:
	mov	x0, x19
	mov	x2, x21
	bl	_ath10k_err
	b	LBB0_9
LBB0_3:
	ldr	x8, [x19, #8]
	ldp	w3, w2, [x8, #4]
	cbz	w2, LBB0_7
; %bb.4:
	cbz	w3, LBB0_7
; %bb.5:
Lloh2:
	adrp	x23, _ATH10K_DBG_BOOT@GOTPAGE
Lloh3:
	ldr	x23, [x23, _ATH10K_DBG_BOOT@GOTPAGEOFF]
	ldr	w1, [x23]
	str	x3, [sp]
Lloh4:
	adrp	x2, l_.str.2@PAGE
Lloh5:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x3, x20
	bl	_ath10k_dbg
	ldr	x8, [x19, #8]
	ldp	w3, w2, [x8, #4]
	mov	x0, x19
	mov	x1, x20
	bl	_ath10k_bmi_fast_download
	cbz	w0, LBB0_10
; %bb.6:
	mov	x21, x0
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_2
LBB0_7:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_ath10k_warn
LBB0_8:
	mov	w21, #0
LBB0_9:
	mov	x0, x21
	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
LBB0_10:
	ldr	x8, [x19]
Lloh10:
	adrp	x9, _ATH10K_PRE_CAL_MODE_DT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _ATH10K_PRE_CAL_MODE_DT@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
Lloh13:
	adrp	x10, _ATH10K_PRE_CAL_MODE_FILE@GOTPAGE
Lloh14:
	ldr	x10, [x10, _ATH10K_PRE_CAL_MODE_FILE@GOTPAGEOFF]
Lloh15:
	ldr	x10, [x10]
	cmp	x8, x10
	ccmp	x8, x9, #4, ne
Lloh16:
	adrp	x8, _BMI_PARAM_FLASH_SECTION_ALL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BMI_PARAM_FLASH_SECTION_ALL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	csel	w2, w8, w22, eq
	add	x3, sp, #12
	mov	x0, x19
	mov	x1, x20
	bl	_ath10k_bmi_execute
	cbz	w0, LBB0_12
; %bb.11:
	mov	x21, x0
Lloh19:
	adrp	x1, l_.str.4@PAGE
Lloh20:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_2
LBB0_12:
	ldr	w1, [x23]
	ldr	w3, [sp, #12]
Lloh21:
	adrp	x2, l_.str.5@PAGE
Lloh22:
	add	x2, x2, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_ath10k_dbg
Lloh23:
	adrp	x8, _skip_otp@GOTPAGE
Lloh24:
	ldr	x8, [x8, _skip_otp@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	cbnz	x8, LBB0_8
; %bb.13:
Lloh26:
	adrp	x8, _ATH10K_FW_FEATURE_IGNORE_OTP_RESULT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ATH10K_FW_FEATURE_IGNORE_OTP_RESULT@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	ldr	x8, [x19, #8]
	ldr	w1, [x8]
	bl	_test_bit
	mov	w21, #0
	cbnz	x0, LBB0_9
; %bb.14:
	ldr	w2, [sp, #12]
	cbz	w2, LBB0_9
; %bb.15:
Lloh29:
	adrp	x1, l_.str.6@PAGE
Lloh30:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_ath10k_err
Lloh31:
	adrp	x8, _EINVAL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_9
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to download board data: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Not running otp, calibration will be incorrect (otp-data %pK otp_len %zd)!\n"

	.comm	_ATH10K_DBG_BOOT,4,2            ; @ATH10K_DBG_BOOT
l_.str.2:                               ; @.str.2
	.asciz	"boot upload otp to 0x%x len %zd\n"

l_.str.3:                               ; @.str.3
	.asciz	"could not write otp (%d)\n"

	.comm	_ATH10K_PRE_CAL_MODE_DT,8,3     ; @ATH10K_PRE_CAL_MODE_DT
	.comm	_ATH10K_PRE_CAL_MODE_FILE,8,3   ; @ATH10K_PRE_CAL_MODE_FILE
	.comm	_BMI_PARAM_FLASH_SECTION_ALL,4,2 ; @BMI_PARAM_FLASH_SECTION_ALL
l_.str.4:                               ; @.str.4
	.asciz	"could not execute otp (%d)\n"

l_.str.5:                               ; @.str.5
	.asciz	"boot otp execute result %d\n"

	.comm	_skip_otp,8,3                   ; @skip_otp
	.comm	_ATH10K_FW_FEATURE_IGNORE_OTP_RESULT,4,2 ; @ATH10K_FW_FEATURE_IGNORE_OTP_RESULT
l_.str.6:                               ; @.str.6
	.asciz	"otp calibration failed: %d"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_ath10k_download_and_run_otp
.subsections_via_symbols
