	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath6kl_upload_firmware
_ath6kl_upload_firmware:                ## @ath6kl_upload_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	xorl	%edi, %edi
	cmpq	$0, 24(%rbx)
	sete	%dil
	callq	_WARN_ON
	xorl	%r14d, %r14d
	testq	%rax, %rax
	jne	LBB0_5
## %bb.1:
	movq	_ATH6KL_DBG_BOOT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	12(%rbx), %r15d
	movl	16(%rbx), %ecx
	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_fast_download
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %r15d
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_ath6kl_err
	movl	%r15d, %r14d
	jmp	LBB0_5
LBB0_3:
	movq	(%rbx), %rax
	movq	_TARGET_TYPE_AR6004@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.4:
	movl	8(%rbx), %esi
	movq	%rbx, %rdi
	callq	_ath6kl_bmi_set_app_start
LBB0_5:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	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 firmware to 0x%x (%zd B)\n"

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

	.comm	_TARGET_TYPE_AR6004,8,3         ## @TARGET_TYPE_AR6004
	.no_dead_strip	_ath6kl_upload_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath6kl_upload_firmware
_ath6kl_upload_firmware:                ; @ath6kl_upload_firmware
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0, #24]
	cmp	x8, #0
	cset	w0, eq
	bl	_WARN_ON
	cbz	x0, LBB0_2
LBB0_1:
	mov	w20, #0
	b	LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _ATH6KL_DBG_BOOT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATH6KL_DBG_BOOT@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldp	w20, w3, [x19, #12]
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_fast_download
	cbz	w0, LBB0_5
; %bb.3:
	mov	x20, x0
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_ath6kl_err
LBB0_4:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	x8, [x19]
Lloh7:
	adrp	x9, _TARGET_TYPE_AR6004@GOTPAGE
Lloh8:
	ldr	x9, [x9, _TARGET_TYPE_AR6004@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_1
; %bb.6:
	ldr	w1, [x19, #8]
	mov	x0, x19
	bl	_ath6kl_bmi_set_app_start
	b	LBB0_1
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ATH6KL_DBG_BOOT,4,2            ; @ATH6KL_DBG_BOOT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"writing firmware to 0x%x (%zd B)\n"

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

	.comm	_TARGET_TYPE_AR6004,8,3         ; @TARGET_TYPE_AR6004
	.no_dead_strip	_ath6kl_upload_firmware
.subsections_via_symbols
