	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mwifiex_pcie_rdwr_firmware
_mwifiex_pcie_rdwr_firmware:            ## @mwifiex_pcie_rdwr_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	(%rax), %r12
	movl	12(%r12), %esi
	leaq	-52(%rbp), %rdx
	callq	_mwifiex_read_reg
	movq	_RDWR_STATUS_FAILURE@GOTPCREL(%rip), %r13
	testq	%rax, %rax
	jne	LBB0_15
## %bb.1:
	movl	8(%r12), %esi
	movq	(%r12), %rdx
	movq	%rbx, %rdi
	callq	_mwifiex_write_reg
	testl	%eax, %eax
	je	LBB0_2
LBB0_11:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_14
LBB0_2:
	movq	_MAX_POLL_TRIES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_13
## %bb.3:
	xorl	%r15d, %r15d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	$100, %edi
	movl	$200, %esi
	callq	_usleep_range
	incl	%r15d
	movq	_MAX_POLL_TRIES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jge	LBB0_13
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	8(%r12), %esi
	movq	%rbx, %rdi
	leaq	-48(%rbp), %rdx
	callq	_mwifiex_read_reg_byte
	movq	-48(%rbp), %rax
	movq	_FW_DUMP_DONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	testq	%r14, %r14
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpq	%r14, %rax
	je	LBB0_8
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	cmpq	(%r12), %rax
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	_WARN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	leaq	L_.str.1(%rip), %rdx
	callq	_mwifiex_dbg
	movl	8(%r12), %esi
	movq	(%r12), %rdx
	movq	%rbx, %rdi
	callq	_mwifiex_write_reg
	testl	%eax, %eax
	je	LBB0_12
	jmp	LBB0_11
LBB0_13:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
LBB0_14:
	movq	%rbx, %rdi
	callq	_mwifiex_dbg
LBB0_15:
	movl	(%r13), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_RDWR_STATUS_SUCCESS@GOTPCREL(%rip), %r13
	jmp	LBB0_15
LBB0_8:
	movq	_RDWR_STATUS_DONE@GOTPCREL(%rip), %r13
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_RDWR_STATUS_FAILURE,4,2        ## @RDWR_STATUS_FAILURE
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PCIE write err\n"

	.comm	_MAX_POLL_TRIES,4,2             ## @MAX_POLL_TRIES
	.comm	_FW_DUMP_DONE,8,3               ## @FW_DUMP_DONE
	.comm	_RDWR_STATUS_SUCCESS,4,2        ## @RDWR_STATUS_SUCCESS
	.comm	_RDWR_STATUS_DONE,4,2           ## @RDWR_STATUS_DONE
	.comm	_WARN,4,2                       ## @WARN
L_.str.1:                               ## @.str.1
	.asciz	"The ctrl reg was changed, re-try again!\n"

L_.str.2:                               ## @.str.2
	.asciz	"Fail to pull ctrl_data\n"

	.no_dead_strip	_mwifiex_pcie_rdwr_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mwifiex_pcie_rdwr_firmware
_mwifiex_pcie_rdwr_firmware:            ; @mwifiex_pcie_rdwr_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x1
	mov	x19, x0
	ldr	x8, [x0]
	ldr	x22, [x8]
	ldr	w1, [x22, #12]
	add	x2, sp, #4
	bl	_mwifiex_read_reg
	cbnz	x0, LBB0_13
; %bb.1:
	ldr	w1, [x22, #8]
	ldr	x2, [x22]
	mov	x0, x19
	bl	_mwifiex_write_reg
	cbz	w0, LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_12
LBB0_3:
Lloh5:
	adrp	x24, _MAX_POLL_TRIES@GOTPAGE
Lloh6:
	ldr	x24, [x24, _MAX_POLL_TRIES@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.4:
	mov	w25, #0
Lloh7:
	adrp	x27, _FW_DUMP_DONE@GOTPAGE
Lloh8:
	ldr	x27, [x27, _FW_DUMP_DONE@GOTPAGEOFF]
Lloh9:
	adrp	x23, _RDWR_STATUS_SUCCESS@GOTPAGE
Lloh10:
	ldr	x23, [x23, _RDWR_STATUS_SUCCESS@GOTPAGEOFF]
Lloh11:
	adrp	x26, _RDWR_STATUS_DONE@GOTPAGE
Lloh12:
	ldr	x26, [x26, _RDWR_STATUS_DONE@GOTPAGEOFF]
Lloh13:
	adrp	x21, l_.str.1@PAGE
Lloh14:
	add	x21, x21, l_.str.1@PAGEOFF
Lloh15:
	adrp	x28, _WARN@GOTPAGE
Lloh16:
	ldr	x28, [x28, _WARN@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	w0, #100
	mov	w1, #200
	bl	_usleep_range
	add	w25, w25, #1
	ldr	w8, [x24]
	cmp	w25, w8
	b.ge	LBB0_11
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22, #8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_mwifiex_read_reg_byte
	ldr	x8, [sp, #8]
	ldr	x9, [x27]
	cmp	x8, x9
	b.eq	LBB0_14
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	cbz	x20, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	x8, x20
	b.eq	LBB0_15
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x9, [x22]
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x28]
	mov	x0, x19
	mov	x2, x21
	bl	_mwifiex_dbg
	ldr	w1, [x22, #8]
	ldr	x2, [x22]
	mov	x0, x19
	bl	_mwifiex_write_reg
	cbz	w0, LBB0_5
	b	LBB0_2
LBB0_11:
Lloh17:
	adrp	x8, _ERROR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x2, l_.str.2@PAGE
Lloh21:
	add	x2, x2, l_.str.2@PAGEOFF
LBB0_12:
	mov	x0, x19
	bl	_mwifiex_dbg
LBB0_13:
Lloh22:
	adrp	x23, _RDWR_STATUS_FAILURE@GOTPAGE
Lloh23:
	ldr	x23, [x23, _RDWR_STATUS_FAILURE@GOTPAGEOFF]
LBB0_14:
	ldr	w0, [x23]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_15:
	mov	x23, x26
	b	LBB0_14
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_RDWR_STATUS_FAILURE,4,2        ; @RDWR_STATUS_FAILURE
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PCIE write err\n"

	.comm	_MAX_POLL_TRIES,4,2             ; @MAX_POLL_TRIES
	.comm	_FW_DUMP_DONE,8,3               ; @FW_DUMP_DONE
	.comm	_RDWR_STATUS_SUCCESS,4,2        ; @RDWR_STATUS_SUCCESS
	.comm	_RDWR_STATUS_DONE,4,2           ; @RDWR_STATUS_DONE
	.comm	_WARN,4,2                       ; @WARN
l_.str.1:                               ; @.str.1
	.asciz	"The ctrl reg was changed, re-try again!\n"

l_.str.2:                               ; @.str.2
	.asciz	"Fail to pull ctrl_data\n"

	.no_dead_strip	_mwifiex_pcie_rdwr_firmware
.subsections_via_symbols
