	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath6kl_upload_patch
_ath6kl_upload_patch:                   ## @ath6kl_upload_patch
	.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
	cmpq	$0, 8(%rdi)
	je	LBB0_4
## %bb.1:
	movq	%rdi, %rbx
	movl	(%rdi), %ecx
	movl	16(%rdi), %r15d
	movq	_ATH6KL_DBG_BOOT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	callq	_ath6kl_dbg
	movq	8(%rbx), %rdx
	movl	(%rbx), %ecx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_ath6kl_bmi_write
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_ath6kl_err
	movl	%r12d, %r14d
	jmp	LBB0_4
LBB0_3:
	movq	_hi_dset_list_head@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_ath6kl_bmi_write_hi32
LBB0_4:
	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 patch to 0x%x (%zd B)\n"

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

	.comm	_hi_dset_list_head,4,2          ## @hi_dset_list_head
	.no_dead_strip	_ath6kl_upload_patch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath6kl_upload_patch
_ath6kl_upload_patch:                   ; @ath6kl_upload_patch
	.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	x8, [x0, #8]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	w20, [x0, #16]
Lloh0:
	adrp	x8, _ATH6KL_DBG_BOOT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATH6KL_DBG_BOOT@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	w3, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_ath6kl_dbg
	ldr	x2, [x19, #8]
	ldr	w3, [x19]
	mov	x0, x19
	mov	x1, x20
	bl	_ath6kl_bmi_write
	mov	x21, x0
	cbz	w0, LBB0_4
; %bb.2:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_ath6kl_err
	b	LBB0_5
LBB0_3:
	mov	w21, #0
	b	LBB0_5
LBB0_4:
Lloh7:
	adrp	x8, _hi_dset_list_head@GOTPAGE
Lloh8:
	ldr	x8, [x8, _hi_dset_list_head@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_ath6kl_bmi_write_hi32
LBB0_5:
	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	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 patch to 0x%x (%zd B)\n"

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

	.comm	_hi_dset_list_head,4,2          ; @hi_dset_list_head
	.no_dead_strip	_ath6kl_upload_patch
.subsections_via_symbols
