	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath6kl_upload_testscript
_ath6kl_upload_testscript:              ## @ath6kl_upload_testscript
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r14d, %r14d
	cmpl	$2, (%rdi)
	jne	LBB0_8
## %bb.1:
	movq	%rdi, %rbx
	cmpq	$0, 24(%rdi)
	je	LBB0_8
## %bb.2:
	movl	16(%rbx), %ecx
	movl	32(%rbx), %r15d
	movq	_ATH6KL_DBG_BOOT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	callq	_ath6kl_dbg
	movq	24(%rbx), %rdx
	movl	16(%rbx), %ecx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_ath6kl_bmi_write
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_ath6kl_err
	movl	%r12d, %r14d
	jmp	LBB0_8
LBB0_4:
	movq	_hi_ota_testscript@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_ath6kl_bmi_write_hi32
	movq	8(%rbx), %rax
	movq	_AR6004_HW_1_3_VERSION@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.5:
	movq	_AR6004_HW_3_0_VERSION@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.6:
	movq	_hi_end_ram_reserve_sz@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$4096, %edx                     ## imm = 0x1000
	callq	_ath6kl_bmi_write_hi32
LBB0_7:
	movq	_hi_test_apps_related@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_ath6kl_bmi_write_hi32
LBB0_8:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATH6KL_DBG_BOOT,4,2            ## @ATH6KL_DBG_BOOT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"writing testscript to 0x%x (%zd B)\n"

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

	.comm	_hi_ota_testscript,4,2          ## @hi_ota_testscript
	.comm	_AR6004_HW_1_3_VERSION,8,3      ## @AR6004_HW_1_3_VERSION
	.comm	_AR6004_HW_3_0_VERSION,8,3      ## @AR6004_HW_3_0_VERSION
	.comm	_hi_end_ram_reserve_sz,4,2      ## @hi_end_ram_reserve_sz
	.comm	_hi_test_apps_related,4,2       ## @hi_test_apps_related
	.no_dead_strip	_ath6kl_upload_testscript
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath6kl_upload_testscript
_ath6kl_upload_testscript:              ; @ath6kl_upload_testscript
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	w8, [x0]
	cmp	w8, #2
	b.ne	LBB0_7
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_7
; %bb.2:
	ldr	w20, [x19, #32]
Lloh0:
	adrp	x8, _ATH6KL_DBG_BOOT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATH6KL_DBG_BOOT@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	w3, [x19, #16]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	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_write
	cbz	w0, LBB0_4
; %bb.3:
	mov	x21, x0
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_ath6kl_err
	b	LBB0_8
LBB0_4:
Lloh7:
	adrp	x8, _hi_ota_testscript@GOTPAGE
Lloh8:
	ldr	x8, [x8, _hi_ota_testscript@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_ath6kl_bmi_write_hi32
	ldr	x8, [x19, #8]
Lloh10:
	adrp	x9, _AR6004_HW_1_3_VERSION@GOTPAGE
Lloh11:
	ldr	x9, [x9, _AR6004_HW_1_3_VERSION@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
Lloh13:
	adrp	x10, _AR6004_HW_3_0_VERSION@GOTPAGE
Lloh14:
	ldr	x10, [x10, _AR6004_HW_3_0_VERSION@GOTPAGEOFF]
Lloh15:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.eq	LBB0_6
; %bb.5:
Lloh16:
	adrp	x8, _hi_end_ram_reserve_sz@GOTPAGE
Lloh17:
	ldr	x8, [x8, _hi_end_ram_reserve_sz@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #4096
	bl	_ath6kl_bmi_write_hi32
LBB0_6:
Lloh19:
	adrp	x8, _hi_test_apps_related@GOTPAGE
Lloh20:
	ldr	x8, [x8, _hi_test_apps_related@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_ath6kl_bmi_write_hi32
LBB0_7:
	mov	w21, #0
LBB0_8:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_ATH6KL_DBG_BOOT,4,2            ; @ATH6KL_DBG_BOOT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"writing testscript to 0x%x (%zd B)\n"

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

	.comm	_hi_ota_testscript,4,2          ; @hi_ota_testscript
	.comm	_AR6004_HW_1_3_VERSION,8,3      ; @AR6004_HW_1_3_VERSION
	.comm	_AR6004_HW_3_0_VERSION,8,3      ; @AR6004_HW_3_0_VERSION
	.comm	_hi_end_ram_reserve_sz,4,2      ; @hi_end_ram_reserve_sz
	.comm	_hi_test_apps_related,4,2       ; @hi_test_apps_related
	.no_dead_strip	_ath6kl_upload_testscript
.subsections_via_symbols
