	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath10k_bmi_write_memory        ## -- Begin function ath10k_bmi_write_memory
	.p2align	4, 0x90
_ath10k_bmi_write_memory:               ## @ath10k_bmi_write_memory
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movq	%rdx, %r13
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movq	_ATH10K_DBG_BMI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movl	%r12d, %ecx
	movl	%r15d, %r8d
	callq	_ath10k_dbg
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	cmpq	$0, (%rbx)
	je	LBB0_1
## %bb.7:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r14d, %r14d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_ath10k_warn
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_6
LBB0_1:
	testl	%r15d, %r15d
	je	LBB0_5
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_BMI_MAX_DATA_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	$-32, %esi
	movl	%r15d, %edi
	callq	_min
	movl	%eax, %ebx
	movl	-64(%rbp), %edi
	movq	%r13, %rsi
	movl	%eax, %edx
	callq	_memcpy
	movl	%ebx, %edi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movl	$4, %esi
	callq	_roundup
	movq	%r13, %rbx
	movl	%eax, %r13d
	movq	_BMI_WRITE_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	___cpu_to_le32
	movq	%rax, -56(%rbp)
	movl	%r12d, %edi
	callq	___cpu_to_le32
	movq	%rax, -72(%rbp)
	movl	%r13d, %edi
	callq	___cpu_to_le32
	movq	%rax, -80(%rbp)
	leal	32(%r13), %edx
	movq	%r14, %rdi
	leaq	-80(%rbp), %rsi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_ath10k_hif_exchange_bmi_msg
	testl	%eax, %eax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%r13d, %edi
	movl	%r15d, %esi
	callq	_min
	addl	%eax, %r12d
	cltq
	addq	%rax, %rbx
	subl	%eax, %r15d
	movq	%rbx, %r13
	jne	LBB0_2
LBB0_5:
	xorl	%r14d, %r14d
	jmp	LBB0_6
LBB0_3:
	movl	%eax, %r14d
	leaq	L_.str.2(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_ath10k_warn
LBB0_6:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATH10K_DBG_BMI,4,2             ## @ATH10K_DBG_BMI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bmi write address 0x%x length %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"command disallowed\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_BMI_MAX_DATA_SIZE,4,2          ## @BMI_MAX_DATA_SIZE
	.comm	_BMI_WRITE_MEMORY,4,2           ## @BMI_WRITE_MEMORY
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	_ath10k_bmi_write_memory        ; -- Begin function ath10k_bmi_write_memory
	.p2align	2
_ath10k_bmi_write_memory:               ; @ath10k_bmi_write_memory
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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 w25, -72
	.cfi_offset w26, -80
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _ATH10K_DBG_BMI@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATH10K_DBG_BMI@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x3, x22
	mov	x4, x20
	bl	_ath10k_dbg
	ldr	x8, [x19]
	cbz	x8, LBB0_2
; %bb.1:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_ath10k_warn
Lloh7:
	adrp	x8, _EBUSY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_8
LBB0_2:
	cbz	w20, LBB0_6
; %bb.3:
Lloh10:
	adrp	x25, _BMI_MAX_DATA_SIZE@GOTPAGE
Lloh11:
	ldr	x25, [x25, _BMI_MAX_DATA_SIZE@GOTPAGEOFF]
Lloh12:
	adrp	x26, _BMI_WRITE_MEMORY@GOTPAGE
Lloh13:
	ldr	x26, [x26, _BMI_WRITE_MEMORY@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x25]
	sub	w1, w8, #32
	mov	x0, x20
	bl	_min
	mov	x23, x0
	ldr	w0, [sp, #32]
	mov	x1, x21
	mov	x2, x23
	bl	_memcpy
	mov	x0, x23
	mov	w1, #4
	bl	_roundup
	mov	x23, x0
	ldr	w0, [x26]
	bl	___cpu_to_le32
	str	x0, [sp, #40]
	mov	x0, x22
	bl	___cpu_to_le32
	str	x0, [sp, #24]
	mov	x0, x23
	bl	___cpu_to_le32
	str	x0, [sp, #16]
	add	w2, w23, #32
	add	x1, sp, #16
	mov	x0, x19
	mov	x3, #0
	mov	x4, #0
	bl	_ath10k_hif_exchange_bmi_msg
	cbnz	w0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x23
	mov	x1, x20
	bl	_min
	add	w22, w0, w22
	add	x21, x21, w0, sxtw
	subs	w20, w20, w0
	b.ne	LBB0_4
LBB0_6:
	mov	w24, #0
	b	LBB0_8
LBB0_7:
	mov	x24, x0
	str	x24, [sp]
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_ath10k_warn
LBB0_8:
	mov	x0, x24
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_ATH10K_DBG_BMI,4,2             ; @ATH10K_DBG_BMI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bmi write address 0x%x length %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"command disallowed\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_BMI_MAX_DATA_SIZE,4,2          ; @BMI_MAX_DATA_SIZE
	.comm	_BMI_WRITE_MEMORY,4,2           ; @BMI_WRITE_MEMORY
l_.str.2:                               ; @.str.2
	.asciz	"unable to write to the device (%d)\n"

.subsections_via_symbols
