	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath6kl_upload_otp
_ath6kl_upload_otp:                     ## @ath6kl_upload_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, 24(%rdi)
	je	LBB0_1
## %bb.2:
	movq	%rdi, %r15
	movq	8(%rdi), %rbx
	movq	%rbx, -40(%rbp)
	movq	_ATH6KL_DBG_BOOT@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movl	16(%r15), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_ath6kl_dbg
	movq	24(%r15), %rdx
	movl	16(%r15), %ecx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_ath6kl_bmi_fast_download
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_4
LBB0_1:
	xorl	%r14d, %r14d
	jmp	LBB0_11
LBB0_5:
	movq	_hi_app_start@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rdx
	movq	%r15, %rdi
	callq	_ath6kl_bmi_read_hi32
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %r14d
	leaq	L_.str.2(%rip), %rdi
LBB0_4:
	movl	%r14d, %esi
	callq	_ath6kl_err
LBB0_11:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	(%r15), %rcx
	testq	%rcx, %rcx
	je	LBB0_9
## %bb.8:
	leaq	L_.str.5(%rip), %rdx
	jmp	LBB0_10
LBB0_9:
	movq	-40(%rbp), %rcx
	movq	%rcx, (%r15)
	leaq	L_.str.4(%rip), %rdx
LBB0_10:
	movl	(%r12), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_ath6kl_dbg
	movl	(%r12), %edi
	movq	(%r15), %rdx
	leaq	L_.str.6(%rip), %rsi
	xorl	%eax, %eax
	callq	_ath6kl_dbg
	movq	$0, -48(%rbp)
	movq	(%r15), %rsi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_ath6kl_bmi_execute
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_ATH6KL_DBG_BOOT,4,2            ## @ATH6KL_DBG_BOOT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"writing otp to 0x%x (%zd B)\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to upload OTP file: %d\n"

	.comm	_hi_app_start,4,2               ## @hi_app_start
L_.str.2:                               ## @.str.2
	.asciz	"Failed to read hi_app_start: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"app_start_override_addr%s 0x%x\n"

L_.str.4:                               ## @.str.4
	.asciz	" (from hw)"

L_.str.5:                               ## @.str.5
	.space	1

L_.str.6:                               ## @.str.6
	.asciz	"executing OTP at 0x%x\n"

	.no_dead_strip	_ath6kl_upload_otp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath6kl_upload_otp
_ath6kl_upload_otp:                     ; @ath6kl_upload_otp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_10
; %bb.1:
	mov	x19, x0
	ldr	x20, [x0, #8]
	str	x20, [sp, #24]
Lloh0:
	adrp	x21, _ATH6KL_DBG_BOOT@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ATH6KL_DBG_BOOT@GOTPAGEOFF]
	ldr	w0, [x21]
	ldr	w8, [x19, #16]
	str	x8, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_ath6kl_dbg
	ldr	x2, [x19, #24]
	ldr	w3, [x19, #16]
	mov	x0, x19
	mov	x1, x20
	bl	_ath6kl_bmi_fast_download
	cbz	w0, LBB0_3
; %bb.2:
	mov	x20, x0
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_5
LBB0_3:
Lloh6:
	adrp	x8, _hi_app_start@GOTPAGE
Lloh7:
	ldr	x8, [x8, _hi_app_start@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x2, sp, #24
	mov	x0, x19
	bl	_ath6kl_bmi_read_hi32
	cbz	w0, LBB0_6
; %bb.4:
	mov	x20, x0
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_5:
	mov	x1, x20
	bl	_ath6kl_err
	b	LBB0_11
LBB0_6:
	ldr	x8, [x19]
	cbz	x8, LBB0_8
; %bb.7:
Lloh11:
	adrp	x2, l_.str.5@PAGE
Lloh12:
	add	x2, x2, l_.str.5@PAGEOFF
	b	LBB0_9
LBB0_8:
	ldr	x8, [sp, #24]
	str	x8, [x19]
Lloh13:
	adrp	x2, l_.str.4@PAGE
Lloh14:
	add	x2, x2, l_.str.4@PAGEOFF
LBB0_9:
	ldr	w0, [x21]
	str	x8, [sp]
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_ath6kl_dbg
	ldr	w0, [x21]
	ldr	x2, [x19]
Lloh17:
	adrp	x1, l_.str.6@PAGE
Lloh18:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_ath6kl_dbg
	str	xzr, [sp, #16]
	ldr	x1, [x19]
	add	x2, sp, #16
	mov	x0, x19
	bl	_ath6kl_bmi_execute
LBB0_10:
	mov	w20, #0
LBB0_11:
	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
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_ATH6KL_DBG_BOOT,4,2            ; @ATH6KL_DBG_BOOT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"writing otp to 0x%x (%zd B)\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to upload OTP file: %d\n"

	.comm	_hi_app_start,4,2               ; @hi_app_start
l_.str.2:                               ; @.str.2
	.asciz	"Failed to read hi_app_start: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"app_start_override_addr%s 0x%x\n"

l_.str.4:                               ; @.str.4
	.asciz	" (from hw)"

l_.str.5:                               ; @.str.5
	.space	1

l_.str.6:                               ; @.str.6
	.asciz	"executing OTP at 0x%x\n"

	.no_dead_strip	_ath6kl_upload_otp
.subsections_via_symbols
