	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mwl8k_feed_fw_image
_mwl8k_feed_fw_image:                   ## @mwl8k_feed_fw_image
	.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
	movq	%rdx, %r13
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1024, %edi                     ## imm = 0x400
	callq	_kmalloc
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movl	$1000, %r15d                    ## imm = 0x3E8
	xorl	%r12d, %r12d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r14d, %r14d
	movq	_EPROTO@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	decl	%r15d
	movl	$1, %edi
	callq	_udelay
	movl	%r12d, %ebx
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, %r12d
	testl	%r15d, %r15d
	jle	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_MWL8K_HIU_SCRATCH@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	addq	(%rax), %rdi
	callq	_ioread32
	movl	%eax, %ebx
	testb	$1, %bl
	jne	LBB0_3
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	addl	%r12d, -44(%rbp)                ## 4-byte Folded Spill
	movslq	%r12d, %rax
	subq	%rax, %r13
	cmpl	$1024, %ebx                     ## imm = 0x400
	jle	LBB0_9
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	andl	$-2, %ebx
	decl	%r15d
	cmpl	$1024, %ebx                     ## imm = 0x400
	jg	LBB0_10
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movslq	%ebx, %rax
	cmpq	%rax, %r13
	jb	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	testq	%r13, %r13
	je	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	testl	%ebx, %ebx
	je	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_2 Depth=1
	movslq	-44(%rbp), %rax                 ## 4-byte Folded Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rsi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_memcpy
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	_mwl8k_send_fw_load_cmd
	xorl	%r14d, %r14d
	testl	%eax, %eax
	je	LBB0_5
## %bb.16:
	movl	$1, %r13d
	movl	%eax, %r14d
	jmp	LBB0_17
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_18
LBB0_10:
	movq	_EOVERFLOW@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_17
LBB0_12:
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	jmp	LBB0_17
LBB0_6:
	movl	$1, %r13d
LBB0_17:
	movq	_EREMOTEIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	testq	%r13, %r13
	cmovel	%r14d, %ebx
	testl	%r14d, %r14d
	cmovnel	%r14d, %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
LBB0_18:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MWL8K_HIU_SCRATCH,8,3          ## @MWL8K_HIU_SCRATCH
	.comm	_EOVERFLOW,4,2                  ## @EOVERFLOW
	.comm	_EPROTO,4,2                     ## @EPROTO
	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
	.no_dead_strip	_mwl8k_feed_fw_image
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mwl8k_feed_fw_image
_mwl8k_feed_fw_image:                   ; @mwl8k_feed_fw_image
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #1024
	bl	_kmalloc
	cbz	x0, LBB0_9
; %bb.1:
	mov	x19, x0
	mov	w28, #0
	mov	w25, #0
	mov	w26, #1000
Lloh3:
	adrp	x27, _MWL8K_HIU_SCRATCH@GOTPAGE
Lloh4:
	ldr	x27, [x27, _MWL8K_HIU_SCRATCH@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
Lloh5:
	adrp	x8, _EPROTO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EPROTO@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w23, w8
	sub	w26, w26, #1
	mov	w0, #1
	bl	_udelay
	cmp	w26, #1
	b.lt	LBB0_8
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	ldr	x9, [x27]
	add	x0, x9, x8
	bl	_ioread32
	add	w8, w28, w25
	sub	x9, x20, w28, sxtw
	and	w10, w0, #0xfffffffe
	sub	w11, w26, #1
	tst	w0, #0x1
	csel	x20, x9, x20, eq
	csel	w26, w26, w11, eq
	csel	w25, w8, w25, eq
	csel	w24, w0, w10, eq
	sxtw	x8, w24
	cmp	w24, #1024
	ccmp	x20, x8, #0, le
	b.lo	LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cbz	x20, LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	cbz	w24, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x1, x21, w25, sxtw #2
	mov	x0, x19
	mov	x2, x24
	bl	_memcpy
	mov	x0, x22
	mov	x1, x19
	mov	x2, x24
	bl	_mwl8k_send_fw_load_cmd
	mov	x23, x0
	cbnz	w0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x28, x24
	cmp	w26, #1
	b.ge	LBB0_3
LBB0_8:
	mov	w20, #1
	b	LBB0_12
LBB0_9:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_13
LBB0_10:
Lloh11:
	adrp	x8, _EOVERFLOW@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EOVERFLOW@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_12
LBB0_11:
	mov	w23, #0
LBB0_12:
	cmp	x20, #0
	ccmp	w23, #0, #0, ne
Lloh14:
	adrp	x8, _EREMOTEIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EREMOTEIO@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	csneg	w20, w23, w8, ne
	mov	x0, x19
	bl	_kfree
LBB0_13:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MWL8K_HIU_SCRATCH,8,3          ; @MWL8K_HIU_SCRATCH
	.comm	_EOVERFLOW,4,2                  ; @EOVERFLOW
	.comm	_EPROTO,4,2                     ; @EPROTO
	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
	.no_dead_strip	_mwl8k_feed_fw_image
.subsections_via_symbols
