	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath6kl_bmi_write               ## -- Begin function ath6kl_bmi_write
	.p2align	4, 0x90
_ath6kl_bmi_write:                      ## @ath6kl_bmi_write
	.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
	subq	$3256, %rsp                     ## imm = 0xCB8
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rsi, -3264(%rbp)
	movq	_BMI_WRITE_MEMORY@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rsi, -3288(%rbp)
	cmpq	$0, 24(%rdi)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_ath6kl_err
	movq	_EACCES@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_2:
	movq	%rcx, %rbx
	movq	%rdi, %r13
	movq	(%rdi), %rax
	leaq	24(%rax), %rcx
	cmpq	8(%rdi), %rcx
	jle	LBB0_4
## %bb.3:
	movl	$1, %edi
	callq	_WARN_ON
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	movq	%rdx, %r15
	xorl	%edi, %edi
	cmpq	$3201, %rax                     ## imm = 0xC81
	setae	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movq	_E2BIG@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_16:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_18
## %bb.17:
	movl	%r12d, %eax
	addq	$3256, %rsp                     ## imm = 0xCB8
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	(%r13), %rdx
	movq	16(%r13), %rdi
	addq	$24, %rdx
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	callq	_memset
	movq	_ATH6KL_DBG_BMI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdx
	movq	%rbx, %rcx
	callq	_ath6kl_dbg
	testq	%rbx, %rbx
	je	LBB0_16
## %bb.8:
	movq	%r15, -3280(%rbp)               ## 8-byte Spill
	movq	%rbx, %r15
	movq	%rbx, -3272(%rbp)               ## 8-byte Spill
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	subq	%r15, %rbx
	movq	-3280(%rbp), %rcx               ## 8-byte Reload
	leaq	(%rcx,%rbx,8), %r14
	movq	(%r13), %rax
	addq	$-24, %rax
	cmpq	%rax, %r15
	jge	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r15, %rax
	andq	$3, %rax
	je	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	subq	%rax, %r15
	addq	$4, %r15
	leaq	-3248(%rbp), %rbx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_memcpy
	movq	%r15, %rax
	movq	%rbx, %r14
	jmp	LBB0_13
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r15, %rax
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%rax, -3256(%rbp)
	movq	16(%r13), %rdi
	movl	$8, %edx
	leaq	-3288(%rbp), %rsi
	callq	_memcpy
	movq	16(%r13), %rdi
	addq	$64, %rdi
	movl	$8, %edx
	leaq	-3264(%rbp), %rsi
	callq	_memcpy
	movq	16(%r13), %rdi
	subq	$-128, %rdi
	movl	$8, %edx
	leaq	-3256(%rbp), %rsi
	callq	_memcpy
	movq	16(%r13), %rdi
	movl	$192, %eax
	addq	%rax, %rdi
	movq	-3256(%rbp), %rdx
	movq	%r14, %rsi
	callq	_memcpy
	movq	-3256(%rbp), %rdx
	addq	$24, %rdx
	movq	16(%r13), %rsi
	movq	%r13, %rdi
	callq	_ath6kl_hif_bmi_write
	testl	%eax, %eax
	jne	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	-3256(%rbp), %rax
	addq	%rax, -3264(%rbp)
	subq	%rax, %r15
	movq	-3272(%rbp), %rbx               ## 8-byte Reload
	jne	LBB0_9
	jmp	LBB0_16
LBB0_14:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	callq	_ath6kl_err
	movl	%ebx, %r12d
	jmp	LBB0_16
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_BMI_WRITE_MEMORY,8,3           ## @BMI_WRITE_MEMORY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bmi done sent already, cmd %d disallowed\n"

	.comm	_EACCES,4,2                     ## @EACCES
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_E2BIG,4,2                      ## @E2BIG
	.comm	_ATH6KL_DBG_BMI,4,2             ## @ATH6KL_DBG_BMI
L_.str.1:                               ## @.str.1
	.asciz	"bmi write memory: addr: 0x%x, len: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Unable to write to the device: %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath6kl_bmi_write               ; -- Begin function ath6kl_bmi_write
	.p2align	2
_ath6kl_bmi_write:                      ; @ath6kl_bmi_write
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -72
	.cfi_offset w28, -80
	sub	sp, sp, #3232
	mov	x22, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	str	x1, [sp, #16]
Lloh3:
	adrp	x8, _BMI_WRITE_MEMORY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BMI_WRITE_MEMORY@GOTPAGEOFF]
Lloh5:
	ldr	x1, [x8]
	str	x1, [sp, #8]
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_2
; %bb.1:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_ath6kl_err
Lloh8:
	adrp	x8, _EACCES@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
	b	LBB0_6
LBB0_2:
	mov	x21, x0
	ldp	x8, x9, [x0]
	add	x10, x8, #24
	cmp	x10, x9
	b.le	LBB0_4
; %bb.3:
	mov	w0, #1
	bl	_WARN_ON
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
	mov	x19, x3
	mov	x20, x2
	cmp	x8, #3200
	cset	w0, hi
	bl	_WARN_ON
	cbz	x0, LBB0_9
; %bb.5:
Lloh12:
	adrp	x8, _E2BIG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _E2BIG@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_7:
	ldur	x8, [x29, #-72]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.8:
	mov	x0, x22
	add	sp, sp, #3232
	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
	ldp	x28, x27, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_9:
	ldr	x0, [x21, #16]
	ldr	x8, [x21]
	add	x2, x8, #24
	mov	w1, #0
	bl	_memset
Lloh17:
	adrp	x8, _ATH6KL_DBG_BMI@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ATH6KL_DBG_BMI@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	mov	x3, x19
	bl	_ath6kl_dbg
	cbz	x19, LBB0_17
; %bb.10:
	mov	x24, x19
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	sub	x8, x19, x24
	add	x22, x20, x8, lsl #3
	ldr	x8, [x21]
	sub	x23, x8, #24
	cmp	x24, x23
	b.ge	LBB0_15
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ands	x8, x24, #0x3
	b.eq	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	sub	x8, x24, x8
	add	x23, x8, #4
	add	x0, sp, #24
	mov	x1, x22
	mov	x2, x23
	bl	_memcpy
	mov	x24, x23
	add	x22, sp, #24
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_11 Depth=1
	mov	x23, x24
LBB0_15:                                ;   in Loop: Header=BB0_11 Depth=1
	str	x23, [sp]
	ldr	x0, [x21, #16]
	add	x1, sp, #8
	mov	w2, #8
	bl	_memcpy
	ldr	x8, [x21, #16]
	add	x0, x8, #64
	add	x1, sp, #16
	mov	w2, #8
	bl	_memcpy
	ldr	x8, [x21, #16]
	add	x0, x8, #128
	mov	x1, sp
	mov	w2, #8
	bl	_memcpy
	ldr	x8, [x21, #16]
	add	x0, x8, #192
	ldr	x2, [sp]
	mov	x1, x22
	bl	_memcpy
	ldr	x8, [sp]
	add	x2, x8, #24
	ldr	x1, [x21, #16]
	mov	x0, x21
	bl	_ath6kl_hif_bmi_write
	mov	x22, x0
	cbnz	w0, LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [sp]
	ldr	x9, [sp, #16]
	add	x9, x9, x8
	str	x9, [sp, #16]
	subs	x24, x24, x8
	b.ne	LBB0_11
	b	LBB0_7
LBB0_17:
	mov	w22, #0
	b	LBB0_7
LBB0_18:
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x22
	bl	_ath6kl_err
	b	LBB0_7
LBB0_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_BMI_WRITE_MEMORY,8,3           ; @BMI_WRITE_MEMORY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bmi done sent already, cmd %d disallowed\n"

	.comm	_EACCES,4,2                     ; @EACCES
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_E2BIG,4,2                      ; @E2BIG
	.comm	_ATH6KL_DBG_BMI,4,2             ; @ATH6KL_DBG_BMI
l_.str.1:                               ; @.str.1
	.asciz	"bmi write memory: addr: 0x%x, len: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Unable to write to the device: %d\n"

.subsections_via_symbols
